I have the code for the Camera2 from https://github.com/googlesamples/android-Camera2Basic.
The problem i\'m facing is that when i turn to my Front Camera, i cannot capt
In lockFocus() method, replace line
mCaptureSession.capture(mPreviewRequestBuilder.build(),
mCaptureCallback, mBackgroundHandler);
with
captureStillPicture();
And to prevent Unwanted orientation you can use
/** * Conversion from screen rotation to JPEG orientation. */
static {
ORIENTATIONS.append(Surface.ROTATION_0, 270);
ORIENTATIONS.append(Surface.ROTATION_90, 0);
ORIENTATIONS.append(Surface.ROTATION_180, 180);
ORIENTATIONS.append(Surface.ROTATION_270, 270);
}