androiddynamic-delivery

What is the difference between <uses-feature android:name="android.hardware.camera"/> and <uses-feature android:name="android.hardware.camera.any"/>


Could anyone please explain what is the difference between

<uses-feature android:name="android.hardware.camera"/>

and

<uses-feature android:name="android.hardware.camera.any"/>

also difference between

<dist:device-feature dist:name="android.hardware.camera" />

and

<dist:device-feature dist:name="android.hardware.camera.any" />

Thanks in advance.


Solution

  • When I used getPackageManager().hasSystemFeature(FEATURE_CAMERA) I got a warning indicating to use FEATURE_CAMERA_ANY instead of FEATURE_CAMERA to include devices with front camera as well.

    Thus, FEATURE_CAMERA refers to back-facing camera or the camera that is on the rear side of the smartphone and FEATURE_CAMERA_ANY means any camera - it includes front camera as well

    if we use <uses-feature android:name="android.hardware.camera"/> then devices with only front camera - such as some tablets - will be filtered out.