Android examples for Camera:Back Camera
Get first Back Facing Camera Id
//package com.java2s; import android.hardware.Camera; import android.hardware.Camera.CameraInfo; public class Main { public static int firstBackFacingCameraId() { return firstArgFacingCameraId(CameraInfo.CAMERA_FACING_BACK); }// w w w .j a va 2s . c o m private static int firstArgFacingCameraId(final int cameraFacing) { final int numberOfCameras = Camera.getNumberOfCameras(); int cameraId = 0; for (int i = 0; i < numberOfCameras; i++) { final CameraInfo info = new CameraInfo(); Camera.getCameraInfo(i, info); if (info.facing == cameraFacing) { return i; } } return cameraId; } }