Search code examples
androidandroid-cameraandroid-5.0-lollipop

Android: How can I check if a device has Camera2 api features implemented or not?


Well, how can I check if an android device has Camera2 api features implemented or not? There are many new features in camera2 api such as manual controls. So how can I know whether, which Camera2 api features are implemented or not, programmatically?


Solution

  • Actually, checking for API version 21+ will work. The camera2 API, including CameraManager is part of the system, not dependent on the hardware present. So you can always ask the CameraManager for a list of CameraDevices, which you can then query individually.

    However, I think what you actually mean is "how can I tell if I can set photographic parameters manually using the camera2 API?", which is dependent on the device you have. It depends on what control you need, but the information you need can be gleaned by getting the REQUEST_AVAILABLE_CAPABILITIES metadata field. Hint: look for MANUAL_SENSOR.