17

I've coded my app so that it has some features which it prefers, but otherwise does not need as I want my app to be available to all devices. In my manifest I've set:

<uses-feature android:name="android.hardware.screen.PORTRAIT" android:required="false" />
<uses-feature android:name="android.hardware.telephony" android:required="false" />
<uses-feature android:name="android.hardware.LOCATION" android:required="false" />
<uses-feature android:name="android.hardware.location.GPS" android:required="false" />
<uses-feature android:name="android.hardware.MICROPHONE" android:required="false" />

When I upload my apk file, Google Play still insists that the Portrait, location, GPS and microphone features are required. The telephony one is no longer needed. Any thoughts on what is going on?

TechnoTony
  • 1,587
  • 1
  • 15
  • 24

1 Answers1

41

On reflection the answer was obvious, as telephony is in lower-case. For some reason this requires lower case even though upper case works in my uses-permission declarations. Here's the code which worked:

<uses-feature android:name="android.hardware.screen.portrait" android:required="false" />
<uses-feature android:name="android.hardware.telephony" android:required="false" />
<uses-feature android:name="android.hardware.location" android:required="false" />
<uses-feature android:name="android.hardware.location.gps" android:required="false" />
<uses-feature android:name="android.hardware.microphone" android:required="false" />

Hope this is helpful to someone else!

TechnoTony
  • 1,587
  • 1
  • 15
  • 24
  • 3
    Thanks for posting this question and counterintuitive answer. I had the same problem, and found that the documentation does mention that the features are case-sensitive - http://developer.android.com/guide/topics/manifest/uses-feature-element.html#name – Jim Vitek Feb 24 '14 at 18:52
  • 1
    If it's not really required, what's the point of writing it? What does it do? – android developer Nov 15 '18 at 10:40
  • @androiddeveloper - It's mainly because you can't assume those features are available on all devices. One example we recently encountered is that we had the `CALL_PHONE` permission declared in our manifest, but not ``, so install failed on a handful of devices. Because of this implied feature requirement, we needed to add that `uses-feature` declaration and set `required` to `false` This just means: _the app prefers to use the feature if available, but is designed to run without it_. The Android dev docs (now) outline this. – h-bomb Jan 24 '20 at 16:17
  • @h-bomb The default is that it's required, or not required? – android developer Jan 24 '20 at 20:14
  • @androiddeveloper - If you declare `` **without** a value for `android:required`, the default is `true`. If you don't declare ``, then "Google Play attempts to discover an application's implied feature requirements by examining other elements declared in the manifest file, specifically, `` elements" (like in my example above.) It was a bit confusing at first, until I reviewed this entire page: https://developer.android.com/guide/topics/manifest/uses-feature-element. – h-bomb Jan 24 '20 at 22:36
  • @h-bomb I see. Is there maybe a map between the permissions and the features, like what Play Store does? And are you sure the Play Store does it? Not something before? Are there any articles about this behavior? Also, I've noticed that on some app I have from my job, it doesn't "uses-feature" anywhere, and even though it has plenty of permissions being used (including phone and permissions ), it only got "android.hardware.touchscreen" and "android.hardware.touchscreen.multitouch" being required. How come? – android developer Jan 25 '20 at 13:58
  • @androiddeveloper - Not sure if there is a _map_. I'm sure the Play Store is blocking the install because it's outlined in the dev docs and you can prove it to yourself by side loading the APK. Note that you can find specific device issues within the device catalogue in the Play Console - you may be surprised to find some devices unsupported.The *weird* thing is that only certain devices seem to be affected by this requirement / limitation. In the case I experienced with `android.hardware.telephony`, it was only a very small set of tablets. Google Support was not able to clarify why, though. – h-bomb Jan 25 '20 at 17:21
  • @h-bomb Do you know of some article about this matter? – android developer Jan 25 '20 at 22:48