1

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.

Mayank Kumar Chaudhari
  • 16,027
  • 10
  • 55
  • 122
  • Please check your question as there are no differences (on character level) between code line 1/2 and 3/4. – Robert Mar 01 '20 at 13:15

1 Answers1

3

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.

Mayank Kumar Chaudhari
  • 16,027
  • 10
  • 55
  • 122