Android examples for android.hardware:Camera ID
get Camera Number
import android.content.Context; import android.graphics.Point; import android.hardware.Camera; import android.util.Log; import android.view.Surface; import android.view.WindowManager; import java.util.List; public class Main{ private static int cameraNumber = -1; public static int getCameraNumber() { if (cameraNumber == -1) { cameraNumber = Camera.getNumberOfCameras(); }/* w ww . ja va 2 s. c o m*/ return cameraNumber; } }