Program Resource

Resource libraries for programmers and developers

When creating Android app, uses-feature and uses-permission are used inside manifest, but this might cause unwanted filter-outs.

In my app, I first had manifest as

<uses-permission android:name=&quot;android.permission.CAMERA&quot; />

<uses-feature android:name=&quot;android.hardware.camera.autofocus&quot; />
<uses-feature android:name=&quot;android.hardware.camera&quot; />

but since app was usable without camera, I’ve changed to as follows for request from user who wanted to use app with device  without camera.

<uses-permission android:name=&quot;android.permission.CAMERA&quot; />

However, this didn’t list up app in Google Play. I had to write like this:

<uses-permission android:name=&quot;android.permission.CAMERA&quot; />

<uses-feature android:name=&quot;android.hardware.camera.autofocus&quot; android:required=&quot;false&quot; />
<uses-feature android:name=&quot;android.hardware.camera&quot; android:required=&quot;false&quot; />

Write uses-feature for camera, and add android:required=”false” parameter to clarify camera is not required.

Android device with front-only camera device was also filtered in first 2 manifest code.

Not only camera, location and bluetooth, which was part of function but not mandatory to app, was causing device without GPS and Bluetooth to be filtered out due to uses-permission option.

I finally got over 1000 additional device supported, by writing manifest like follows.

<uses-permission android:name=&quot;android.permission.INTERNET&quot; />
<uses-permission android:name=&quot;android.permission.WRITE_EXTERNAL_STORAGE&quot;/>
<uses-permission android:name=&quot;android.permission.VIBRATE&quot;/>
<uses-permission android:name=&quot;android.permission.ACCESS_COARSE_LOCATION&quot; />
<uses-permission android:name=&quot;android.permission.ACCESS_NETWORK_STATE&quot;/>
<uses-permission android:name=&quot;android.permission.BLUETOOTH&quot;/>
<uses-permission android:name=&quot;android.permission.BLUETOOTH_ADMIN&quot;/>
<uses-permission android:name=&quot;android.permission.CAMERA&quot; />

<uses-feature android:name=&quot;android.hardware.bluetooth&quot; android:required=&quot;false&quot; />
<uses-feature android:name=&quot;android.hardware.camera.autofocus&quot; android:required=&quot;false&quot; />
<uses-feature android:name=&quot;android.hardware.camera&quot; android:required=&quot;false&quot; />
<uses-feature android:name=&quot;android.hardware.location&quot; android:required=&quot;false&quot; />
<uses-feature android:name=&quot;android.hardware.location.gps&quot; android:required=&quot;false&quot; />
<uses-feature android:name=&quot;android.hardware.location.network&quot; android:required=&quot;false&quot; />
<uses-feature android:name=&quot;android.hardware.touchscreen&quot; android:required=&quot;false&quot; />

Point is writing  required=”false” for non-mandatory features.

You can check supported and filtered out devices from Developer Console, under APK.

devcon_device

Print Friendly, PDF & Email

This post is also available in: Japanese

Leave a Reply

Your email address will not be published. Required fields are marked *


*

CAPTCHA