Code example for Camera

Methods: release

	protected void onPause() { 
		if (mCamera != null) {
			mCamera.release(); // release the camera for other applications
			mCamera = null;
	/** A safe way to get an instance of the Camera object. */ 
	public static Camera getCameraInstance() {
		Camera c = null;
		try { 
			c =; // 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
Stop searching for code, let great code find you!  Add Codota to your java IDE