Android: Check whether camera supports auto-focus?

前端 未结 5 1242
眼角桃花
眼角桃花 2020-12-31 02:17

For the Android API version 2.1 and higher, we can use context:

getPackageManager().hasSystemFeature(PackageManager.FEATURE_CAMERA_AUTOFOCUS)
5条回答
  •  梦谈多话
    2020-12-31 03:19

    There are a number of methods of the Camera.Parameters class added in API Level 5 (I believe that maps to Android 2.0) that will return a list of supported features. Call getSupportedFocusModes on the Camera.Parameters object retrieved from camera.getParameters()

    http://developer.android.com/reference/android/hardware/Camera.Parameters.html

提交回复
热议问题