Code example for Camera: Taking pictures with the camera

Methods: takePicture

0
		mTextureView.setRotation(45.0f);
 
	} 
 
	public void onClick(View view) {
		camera.takePicture(null, null,
				new PhotoHandler(getApplicationContext()));
	} 
 
	private int findFirstFrontFacingCamera() { 
		int cameraId = -1;
		// search for the first 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) {
				cameraId = i;
				break; 
			} 
		}