|
|
|
|
|
|
|
|
// Calling Activity |
|
|
// Calling Activity |
|
|
private final Context context; |
|
|
private final Context context; |
|
|
|
|
|
|
|
|
// Permission handling |
|
|
|
|
|
private static final int PERMISSION_REQUEST_CODE = 3691; |
|
|
|
|
|
|
|
|
|
|
|
// Camera Provider |
|
|
// Camera Provider |
|
|
private ProcessCameraProvider cameraProvider; |
|
|
private ProcessCameraProvider cameraProvider; |
|
|
private ImageAnalysis imageAnalysis; |
|
|
private ImageAnalysis imageAnalysis; |
|
|
|
|
|
|
|
|
this.outputImageView = outputImageView; |
|
|
this.outputImageView = outputImageView; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
private void setPreviewView(@NonNull PreviewView previewView) { |
|
|
private void setPreviewView(@NonNull PreviewView previewView) { |
|
|
// Create Preview |
|
|
// Create Preview |
|
|
|
|
|
|
|
|
*/ |
|
|
*/ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** Generate File Name */ |
|
|
/** Generate File Name */ |
|
|
private String generateFileName(){ |
|
|
private String generateFileName(){ |
|
|
// Get the current timestamp |
|
|
// Get the current timestamp |