How to detect if there is a front camera and if there is how to reach and use front camera ?
Oak your code will not support sdk above 21 so i have added these lines to make it useable :)
int getFrontCameraId(CameraManager cManager) {
if (Build.VERSION.SDK_INT < 22) {
Camera.CameraInfo ci = new Camera.CameraInfo();
for (int i = 0; i < Camera.getNumberOfCameras(); i++) {
Camera.getCameraInfo(i, ci);
if (ci.facing == Camera.CameraInfo.CAMERA_FACING_FRONT) return i;
}
} else {
try {
for ( int j = 0;j
I have updated the code of Oak which now supports new camera2 library also.