I am trying to implment camera option using androidX.camera2. I am following https://developer.android.com/training/camerax/take-photo.
I have added this libraries :
def camerax_version = "1.0.0-alpha08"
implementation "androidx.camera:camera-core:${camerax_version}"
implementation "androidx.camera:camera-camera2:${camerax_version}"
implementation "androidx.camera:camera-view:1.0.0-alpha05"
implementation "androidx.camera:camera-lifecycle:1.0.0-alpha02"
On bindPreview function i have add code for image capture.
ImageCaptureConfig config = new ImageCaptureConfig.Builder()
.setTargetRotation(getWindowManager().getDefaultDisplay().getRotation())
.build();
ImageCapture imageCapture = new ImageCapture(config);
but builder function is showing error.
How can i solve this error?
From 1.0.0-alpha07 configuration is different:
ImageCapture imageCapture = new ImageCapture.Builder()
.setTargetRotation(getWindowManager().getDefaultDisplay().getRotation())
.build();
Camera camera = cameraProvider.bindToLifecycle(this, cameraSelector, preview, imageCapture);
You should see changelog for details.