Code example for Camera: Taking pictures with the camera

Methods: takePicture

0
			} 
		} 
	} 
 
	public void onClick(View view) {
		camera.takePicture(null, null,
				new PhotoHandler(getApplicationContext()));
	} 
 
	private int findFrontFacingCamera() { 
		int cameraId = -1;
		// Search for the front facing camera 
		int numberOfCameras = Camera.getNumberOfCameras();
		for (int i = 0; i < numberOfCameras; i++) {
			CameraInfo info = new CameraInfo();
			Camera.getCameraInfo(i, info);
			if (info.facing == CameraInfo.CAMERA_FACING_FRONT) {
				Log.d(DEBUG_TAG, "Camera found");
				cameraId = i;
				break; 
			}