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
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));
}