Camera 2 API
suggest changeVersions
android.hardware.camera2 was added in Android 5.0 (API 21).
Parameters
| Type | Details |
|---|---|
CameraCaptureSession |
A configured capture session for a CameraDevice, used to capture images or to reprocess images already captured in that session. |
CameraDevice |
One camera connected to the Android device. |
CameraCharacteristics |
Fixed properties of a CameraDevice. Query them with CameraManager.getCameraCharacteristics(String). |
CameraManager |
System service that finds cameras and opens a connection. Obtain it with Context.getSystemService(). |
CaptureRequest |
Immutable settings and outputs for one capture: sensor, lens, flash, processing, and the target Surfaces. Build one with CaptureRequest.Builder from createCaptureRequest(int). |
CaptureResult |
A subset of the result of one capture. A CameraDevice produces it after processing a CaptureRequest. |
Remarks
- Camera2 APIs are available in API 21+ (Lollipop and beyond)
- A device with an official API 21+ system image may still not implement Camera2 fully. That is up to the manufacturer (for example, the LG G2 has official Lollipop and no Camera2 API).
android.hardware.Camera(Camera1) is deprecated as of Camera2.- These APIs are easy to misuse.
- To take one photo and get the result back, you do not need Camera2. Start the device camera app with an
Intentand read the result.
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents