Android examples for Camera:Camera Attribute
get Camera By Direction
//package com.java2s; import android.hardware.Camera; import android.hardware.Camera.CameraInfo; public class Main { public static int getCameraByDirection(int direction) { int numCameras = Camera.getNumberOfCameras(); CameraInfo info = new CameraInfo(); for (int camid = 0; camid < numCameras; camid++) { Camera.getCameraInfo(camid, info); if (info.facing == direction) { return camid; }// w w w . ja v a2s .c o m } return -1; } }