Android Camera Set getBackId()

Here you can find the source of getBackId()

Description

get Back Id

Declaration

static public int getBackId() throws Exception 

Method Source Code

//package com.java2s;
import android.hardware.Camera;
import android.hardware.Camera.CameraInfo;

public class Main {
    static public int getBackId() throws Exception {
        int numberOfCameras = Camera.getNumberOfCameras();
        CameraInfo cameraInfo = new CameraInfo();
        for (int i = 0; i < numberOfCameras; i++) {
            Camera.getCameraInfo(i, cameraInfo);
            if (cameraInfo.facing == CameraInfo.CAMERA_FACING_BACK) {
                return i;
            }/*from   w  ww  .  j a v  a 2s.  co  m*/
        }
        throw new Exception();
    }
}

Related

  1. setInvertColor(Camera.Parameters parameters)
  2. setMetering(Camera.Parameters parameters)
  3. setTorch(Camera.Parameters parameters, boolean on)
  4. setVideoStabilization(Camera.Parameters parameters)
  5. setZoom(Camera.Parameters parameters, double targetZoomRatio)
  6. adjustCamera(Context context, Camera camera)