I have created an app that check if WIFI/GPS is enabled in a mobile phone along with some other data..
If WIFI is enabled then will do some action else it will skip that portion.. So this basically means that Availability of WIFI/GPS is not a requisite for my app..
But after uploading my app in the android market, it shows..
This apk requests 4 features that will be used for Android Market filtering
android.hardware.wifi
android.hardware.location
android.hardware.location.gps
android.hardware.touchscreen
All these 4 is not a requisite for my app.. then why its showing that my app will be filtered based on these..
Also if i set the tag to false in my android manifest will my app be visible to all the phones especially those without touchscreen,wifi,gps and all???
<uses-feature android:name="android.hardware.wifi" 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.touchscreen" android:required="false" />
Will my app be visible to all phones irrespective of any filtering if i set the tag to false ???
You want to set android:required to false. What that tag means (when you set the attribute to false) is that your app could use that feature, but doesn't require that the phone have it to run - which is what you want, it sounds like.
In my opinion, that's not a bad thing. If somebody wants an app that uses GPS, they won't filter against it.
If your app secretly uses GPS to track them, then they'll know their "Game" uses GPS so it works for them, and you'll get a bad review.
Related
In manifest I have:
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
I use WebView in my android app to display some websites which may request location. 4 out of 100 websites request location sometimes. So that means that if location is not provided then application will also work, it will load other 96 websites. So is there any need to add following tag in manifest since I am using location permission?
<uses-feature
android:name="android.hardware.location"
android:required="true" />
I am asking this question because there is one note on documentation page which says:
Caution: If your app targets Android 5.0 (API level 21) or higher and uses the ACCESS_COARSE_LOCATION or ACCESS_FINE_LOCATION permission in order to receive location updates from the network or a GPS, respectively, you must also explicitly declare that your app uses the android.hardware.location.network or android.hardware.location.gps hardware features.
Note that I am targeting api level 30 so I am using android.hardware.location
Now my question:
Since 96 websites will work in WebView without location can I set android:required="false" in tag?
I need to create app with optional NFC functionality.
Can I get access to NFC without manifest permission (Android)? Or should I create two apps: an NFC version and one without it.
Updated as per finding of thorbear
The uses-feature element so that your application shows up in Google Play only for devices that have NFC hardware:
<uses-feature android:name="android.hardware.nfc" android:required="true" />
If your application uses NFC functionality, but that functionality is not crucial to your application, you can omit the uses-feature element and check for NFC avalailbility at runtime by checking to see if getDefaultAdapter() is null.
This is not possible without adding permission into manifest. And you
do not required to create two apps for such case.
Read Requesting NFC Access in the Android Manifest for more details
But yes you have a way to say "My application uses NFC feature but optional".
For this you need to add <uses-feature android:name="android.hardware.nfc" android:required="false" /> into manifest. So Google play can make your application available for all devices which have NFC or not have.
Note : If you do not add this <uses-feature .../> tag into manifest with android:required="false", Google Play will treat your application as "this application is only for devices which having NFC". And a device which does not have NFC feature, can not download your application from Google Play.
Here is manifest example
<manifest ...>
<uses-feature android:name="android.hardware.nfc" android:required="true" />
<uses-permission android:name="android.permission.NFC" />
</manifest>
Read more about <uses-feature>
You can't get access to NFC without adding the following permission to your manifest.
<uses-permission android:name="android.permission.NFC" />
<uses-permission android:name="android.permission.PHONE_STATE" />
<uses-permission android:name="android.permission.READ_CONTACTS" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission
android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_USER_DICTIONARY" />
<uses-permission android:name="android.permission.CALL_PHONE" />
<uses-permission android:name="android.permission.READ_USER_DICTIONARY" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_MOCK_LOCATION" />
<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.location.network"
android:required="false" />
<uses-feature
android:name="android.hardware.wifi"
android:required="false" />
<uses-feature
android:name="android.hardware.telephony"
android:required="false" />
<uses-feature
android:glEsVersion="0x00020000"
android:required="true" />
I have basically declares this in the manifest. I want to know what exactly uses feature does.
From my understanding, if i declared permission access_coarse_location and all that, this means my app uses feature android.hardware.location ..and for that automatically thats set for true.
By specifying that feature to false, am telling android store..that a user can download this app even if he doesn't have location hardware..because this thing is handled inside code?
Is my understanding right? Because i find it funny there is feature android.hardware.wifi ..
what phone, mobile device doesn't have a wifi?
yup your understanding is correct.
From https://developer.android.com/guide/topics/manifest/uses-feature-element:
Google Play uses the elements declared in your app
manifest to filter your app from devices that do not meet it's
hardware and software feature requirements. By specifying the features
that your application requires, you enable Google Play to present your
application only to users whose devices meet the application's feature
requirements, rather than presenting it to all users
I want to know what exactly uses feature does
Quoting the documentation:
The purpose of a declaration is to inform any external entity of the set of hardware and software features on which your application depends. The element offers a required attribute that lets you specify whether your application requires and cannot function without the declared feature, or whether it prefers to have the feature but can function without it. Because feature support can vary across Android devices, the element serves an important role in letting an application describe the device-variable features that it uses.
Here, "external entity" usually means an app distribution channel, like the Play Store.
Is my understanding right?
Yes. One role of <uses-feature> is to indicate that some feature is not required, where a permission would imply that it is required.
Because i find it funny there is feature android.hardware.wifi .. what phone, mobile device doesn't have a wifi?
There is no requirement that Android devices support WiFi. For example, Android is used in vehicles, from cars to the Boeing 787 Dreamliner, and those environments may not offer WiFi.
You are correct in your understanding. The uses tag is mainly for filtering on the play store. Which means that users who may have a device that doesn't support a required feature that your app depends on, will not see your app in the listings.
As an aside. There are plenty of Android devices which don't feature a wireless chipset. I've been working with Android based Barcode scanners that don't have Wifi, nor GPS services. It's always best to handle things in code, depending on what the device is capable of.
Hope this helps.
I have the application in Google Play. Today supported 5215 devices. The application has in AndroidManifest.xml the following:
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
Obviously, in Google Play Console I see that features are included
android.hardware.LOCATION
android.hardware.location.GPS
android.hardware.location.NETWORK
and permissions are included
android.permission.ACCESS_COARSE_LOCATION
android.permission.ACCESS_FINE_LOCATION
The problem that our customer has device without GPS, and the application isn't available in Google Play on this device.
I've read on developers site that I can add <uses-feature> tag with android:required="false" parameter. So I added:
<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.location.NETWORK" android:required="false"/>
Nothing changed, the same 5215 devices. But if I delete request for android.permission.ACCESS_FINE_LOCATION permission, 5856 devices are available (added 641).
What's wrong? How to publish the app for devices with and without GPS together?
pretty sure this is what you need
<uses-feature android:name="android.hardware.location.gps" android:required="false" />
GPS is different than gps
Though I am not sure but it seem like if you request
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
It enables the gps settings to true no-matter what you specify. The only surest way to find out is to ignore the numbers of supported devices for the moment and publish your app in play store with the manifest that you have shown here and try downloading the app in devices with and without gps chipset.
I have an app the optionally requires BT - so I put
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
<uses-permission android:name="android.permission.BLUETOOTH" />
in the manifest.
The problem is that this filters out all Android devices which do not have BT.
But I need to make it optional! So they should be still compatible so that users can install the app from GooglePLay - I will just deactivate the BT option in the app in that case.
Is that possible?
Add this to your AndroidManifest.xml:
<uses-feature android:name="android.hardware.bluetooth"
android:required="false"/>
This is what the docs say about Play Store filtering through use of permissions:
In some cases, the permissions that you request through can affect how your application is filtered by Google Play.
If you request a hardware-related permission — CAMERA, for example — Google Play assumes that your application requires the underlying hardware feature and filters the application from devices that do not offer it.
To control filtering, always explicitly declare hardware features in elements, rather than relying on Google Play to "discover" the requirements in elements. Then, if you want to disable filtering for a particular feature, you can add a android:required="false" attribute to the declaration.