Using the Camera API
Up to this point, you have been doing basic activity-creating. Now it is time to take on camera-specific concepts and classes.
Opening and releasing the camera
First, let’s handle the management of the camera resource. You have given CrimeCameraFragment an instance of Camera. The camera is an important system-wide resource, so it is critical to obtain it only when you need it and release it as soon as you are done. Otherwise, the camera will be unavailable to other applications until the device is rebooted.
Here are the Camera methods you will use to manage the Camera instance:
public static Camera open(int cameraId) public static Camera open() ...