Here you can find the source of getCameraInstance()
public static Camera getCameraInstance()
//package com.java2s; import android.hardware.Camera; public class Main { public static Camera getCameraInstance() { Camera c = null;//from w w w .j av a2s . c o m try { c = Camera.open(); // 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 } }