How to add a back camera requirement in the manifest file?

I need to exclude devices that do not have a rear view camera from installing the application. I know in AndoirdManifest.xml. I can mention: -

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

But it will still allow devices that do not have a rear view camera (but they have a front camera) to install the application.

I read in android docs that we can mention the requirements for subforus to have a front camera

 android:name="android.hardware.camera.front". 

But is there a way that I can mention the reverse camera as a requirement. Sort of

 android:name="android.hardware.camera.back" 

There is also a way to check if this requirement will work before releasing it for playback in the store. I tried to test this on emulators and devices, but the application is always installed out of eclipse, even if they don’t have a camera at all.

Thanks! Gagan

+4
source share
1 answer

But it will still allow devices that do not have a rear view camera (but they have a front camera) to install the application

Doesn't match Google :

Single front camera (applications requiring the android.hardware.camera function will not be available on Nexus 7)

Therefore, the correct answer will be your first piece of code above.

If you have evidence that your fragment will not block the first generation Nexus 7, send it.

0
source

Source: https://habr.com/ru/post/1500773/


All Articles