Android Camera Get getCameraInstance()

Here you can find the source of getCameraInstance()

Description

get Camera Instance

Declaration

public static Camera getCameraInstance() 

Method Source Code

//package com.java2s;

import android.hardware.Camera;

public class Main {
    public static Camera getCameraInstance() {
        Camera c = null;/*from  ww  w  .  j  a  v  a  2s  .  c om*/
        try {
            c = Camera.open(Camera.CameraInfo.CAMERA_FACING_FRONT); // attempt to get a Camera instance
        } catch (Exception e) {
            // Camera is not available (in use or does not exist)
        }
        return c; // returns null if camera is unavailable
    }
}

Related

  1. getCameraId()
  2. getCameraId(int facing)
  3. getCameraId(int position)
  4. getCameraInstance()
  5. getCameraInstance()
  6. getDefaultCamera(int position)
  7. getDefaultCamera(int position)
  8. getDefaultCameraInstance()
  9. getDefaultFrontFacingCameraInstance()