{"id":2354,"date":"2013-06-23T22:14:03","date_gmt":"2013-06-23T13:40:50","guid":{"rendered":"https:\/\/programresource.net\/?p=2354"},"modified":"2013-06-23T22:41:32","modified_gmt":"2013-06-23T13:41:32","slug":"pitfall-for-using-uses-permission-writing-manifest-to-increase-supported-devices","status":"publish","type":"post","link":"https:\/\/programresource.net\/en\/2013\/06\/23\/2354.html","title":{"rendered":"Pitfall for using uses-permission, writing manifest to increase supported devices"},"content":{"rendered":"<p>When creating Android app, uses-feature and uses-permission are used inside manifest, but this might cause unwanted filter-outs.<\/p>\n<p>In my app, I first had manifest as<\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">&lt;uses-permission android:name=&amp;quot;android.permission.CAMERA&amp;quot; \/&gt;\r\n\r\n&lt;uses-feature android:name=&amp;quot;android.hardware.camera.autofocus&amp;quot; \/&gt;\r\n&lt;uses-feature android:name=&amp;quot;android.hardware.camera&amp;quot; \/&gt;<\/pre>\n<p>but since app was usable without camera, I&#8217;ve changed to as follows for request from user who wanted to use app with device \u00a0without camera.<\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">&lt;uses-permission android:name=&amp;quot;android.permission.CAMERA&amp;quot; \/&gt;<\/pre>\n<p>However, this didn&#8217;t list up app in Google Play. I had to write like this:<\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">&lt;uses-permission android:name=&amp;quot;android.permission.CAMERA&amp;quot; \/&gt;\r\n\r\n&lt;uses-feature android:name=&amp;quot;android.hardware.camera.autofocus&amp;quot; android:required=&amp;quot;false&amp;quot; \/&gt;\r\n&lt;uses-feature android:name=&amp;quot;android.hardware.camera&amp;quot; android:required=&amp;quot;false&amp;quot; \/&gt;<\/pre>\n<p>Write uses-feature for camera, and add android:required=&#8221;false&#8221; parameter to clarify camera is not required.<\/p>\n<p>Android device with front-only camera device was also filtered in first 2 manifest code.<\/p>\n<p>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.<\/p>\n<p>I finally got over 1000 additional device supported, by writing manifest like follows.<\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">&lt;uses-permission android:name=&amp;quot;android.permission.INTERNET&amp;quot; \/&gt;\r\n&lt;uses-permission android:name=&amp;quot;android.permission.WRITE_EXTERNAL_STORAGE&amp;quot;\/&gt;\r\n&lt;uses-permission android:name=&amp;quot;android.permission.VIBRATE&amp;quot;\/&gt;\r\n&lt;uses-permission android:name=&amp;quot;android.permission.ACCESS_COARSE_LOCATION&amp;quot; \/&gt;\r\n&lt;uses-permission android:name=&amp;quot;android.permission.ACCESS_NETWORK_STATE&amp;quot;\/&gt;\r\n&lt;uses-permission android:name=&amp;quot;android.permission.BLUETOOTH&amp;quot;\/&gt;\r\n&lt;uses-permission android:name=&amp;quot;android.permission.BLUETOOTH_ADMIN&amp;quot;\/&gt;\r\n&lt;uses-permission android:name=&amp;quot;android.permission.CAMERA&amp;quot; \/&gt;\r\n\r\n&lt;uses-feature android:name=&amp;quot;android.hardware.bluetooth&amp;quot; android:required=&amp;quot;false&amp;quot; \/&gt;\r\n&lt;uses-feature android:name=&amp;quot;android.hardware.camera.autofocus&amp;quot; android:required=&amp;quot;false&amp;quot; \/&gt;\r\n&lt;uses-feature android:name=&amp;quot;android.hardware.camera&amp;quot; android:required=&amp;quot;false&amp;quot; \/&gt;\r\n&lt;uses-feature android:name=&amp;quot;android.hardware.location&amp;quot; android:required=&amp;quot;false&amp;quot; \/&gt;\r\n&lt;uses-feature android:name=&amp;quot;android.hardware.location.gps&amp;quot; android:required=&amp;quot;false&amp;quot; \/&gt;\r\n&lt;uses-feature android:name=&amp;quot;android.hardware.location.network&amp;quot; android:required=&amp;quot;false&amp;quot; \/&gt;\r\n&lt;uses-feature android:name=&amp;quot;android.hardware.touchscreen&amp;quot; android:required=&amp;quot;false&amp;quot; \/&gt;<\/pre>\n<p>Point is writing\u00a0\u00a0required=&#8221;false&#8221; for non-mandatory features.<\/p>\n<p>You can check supported and filtered out devices from Developer Console, under APK.<\/p>\n<p><a href=\"https:\/\/programresource.net\/images\/2013\/06\/devcon_device.png\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-medium wp-image-2351 aligncenter\" alt=\"devcon_device\" src=\"https:\/\/programresource.net\/images\/2013\/06\/devcon_device-300x102.png\" width=\"300\" height=\"102\" srcset=\"https:\/\/programresource.net\/images\/2013\/06\/devcon_device-300x102.png 300w, https:\/\/programresource.net\/images\/2013\/06\/devcon_device.png 630w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>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 but since app was usable without camera, I&#8217;ve changed to as follows for request from user who wanted to use app with device \u00a0without camera. However, this didn&#8217;t list up app in Google Play. I had to write like this: Write uses-feature for camera, and add android:required=&#8221;false&#8221; 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 &#8230;<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"ngg_post_thumbnail":0,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","footnotes":"","jetpack_publicize_message":"","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false}}},"categories":[330],"tags":[558,554,557,560,559,555,556],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p3pJyQ-BY","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/programresource.net\/en\/wp-json\/wp\/v2\/posts\/2354"}],"collection":[{"href":"https:\/\/programresource.net\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/programresource.net\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/programresource.net\/en\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/programresource.net\/en\/wp-json\/wp\/v2\/comments?post=2354"}],"version-history":[{"count":2,"href":"https:\/\/programresource.net\/en\/wp-json\/wp\/v2\/posts\/2354\/revisions"}],"predecessor-version":[{"id":2356,"href":"https:\/\/programresource.net\/en\/wp-json\/wp\/v2\/posts\/2354\/revisions\/2356"}],"wp:attachment":[{"href":"https:\/\/programresource.net\/en\/wp-json\/wp\/v2\/media?parent=2354"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/programresource.net\/en\/wp-json\/wp\/v2\/categories?post=2354"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/programresource.net\/en\/wp-json\/wp\/v2\/tags?post=2354"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}