Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 226
Vivek Sasidharan Avatar asked Jun 21 '15 06:06

Vivek Sasidharan


People also ask

How do I know if my phone has Camera2 API?

Well, all you need to do is download a simple app called 'Camera2 API probe' from the Google Play Store and run it. The app gives detailed info about both the rear and front camera sensors of your Android phone. From that info, you can easily deduce whether your Android device supports Camera2 API or not.

How do I know if my phone supports GCam?

Your Android device must have Camera2API support to run the latest GCam 7.0. To check the compatibility, download the Camera2 API Probe app (Free) and open it. If it shows “LIMITED”, “FULL” or “LEVEL_3” then you are good to go.


1 Answers

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:

CameraManager manager = (CameraManager) activity.getSystemService(Context.CAMERA_SERVICE);

for (String cameraId : manager.getCameraIdList()) {
                    CameraCharacteristics characteristics
                            = manager.getCameraCharacteristics(cameraId);


    Log.d("Img", "INFO_SUPPORTED_HARDWARE_LEVEL " + characteristics.get(CameraCharacteristics.INFO_SUPPORTED_HARDWARE_LEVEL));
 }
like image 152
user2924714 Avatar answered Sep 28 '22 06:09

user2924714