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?
相关问题
- How can I create this custom Bottom Navigation on
- Bottom Navigation View gets Shrink Down
- How to make that the snackbar action button be sho
- Listening to outgoing sms not working android
- How to create Circular view on android wear?
相关文章
- android开发 怎么把图片放入drawable的文件夹下
- android上如何获取/storage/emulated/下的文件列表
- androidStudio有个箭头不认识
- SQLite不能创建表
- Windows - Android SDK manager not listing any plat
- Animate Recycler View grid when number of columns
- Why is the app closing suddenly without showing an
- Android OverlayItem.setMarker(): Change the marker
Camera API2
The Camera API2 framework exposes lower-level camera control to the app, including efficient zero-copy burst/streaming flows and per-frame controls of exposure, gain, white balance gains, color conversion, denoising, sharpening, and more. For details, watch the Google I/O video overview.
Android 5.0 and later includes Camera API2; however, devices running Android 5.0 and later may not support all Camera API2 features. The android.info.supportedHardwareLevel property that apps can query through the Camera API2 interfaces reports one of the following support levels:
This What is Camera2 API? Check if your Smartphone supports it may help you to find it out!
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 theCameraManager
for a list ofCameraDevice
s, 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 forMANUAL_SENSOR
.I also needed this for another project, so I wrote a small app that probes all camera2 features and shows which ones are available on the phone: https://play.google.com/store/apps/details?id=de.weis.camera2probe
You can email this report in-app. I list all reports that I received here: https://github.com/TobiasWeis/android-camera2probe/wiki (The code of the app is also available there, in case someone needs to integrate into their own project)
Indeed, the camera2 api is only supported from API level 21. But only this check is not enough. There are devices with API level 21, but that support the camera 2 only partially. To check this, you should check the value of CameraCharacteristics.INFO_SUPPORTED_HARDWARE_LEVEL. It can be FULL, LEGACY or LIMITED. Check here for details: https://developer.android.com/reference/android/hardware/camera2/CameraCharacteristics.html
Here is how to get it:
In cases if someone needs full snippet of how to determine which camera in the device has Camera2 API support (at least limited support):
Install the app: Manual Camera Compatibility. It checks for Manual Focus, WB, ISO, Shutter speed and RAW support. All exposed via the camera2 HAL driver. I've installed the above in the AT&T store to check phones before buying. A great way to know if you're buying yesterday's model.
https://play.google.com/store/apps/details?id=pl.vipek.camera2_compatibility_test&hl=en