<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.
Related
I use the following permission in my application
<uses-permission android:name="android.permission.SEND_SMS" />
<uses-permission android:name="android.permission.RECEIVE_SMS"/>
<uses-permission android:name="android.permission.READ_SMS" />
<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_WIFI_STATE"/>
and i made a sample application which is not visible in play store for tablet devices.
So my question is, for which permission google is not showing the app for tab devices?
i know some tablet devices dont have sim, so sms permission could be it, but tab which has sim in it, also cant see the app in play store.
Aside from minSdkVersion that may affect visibility, your Manifest may lack support-screens tag:
<supports-screens
android:anyDensity="true"
android:largeScreens="true"
android:normalScreens="true"
android:resizeable="true"
android:smallScreens="true"
android:xlargeScreens="true"/>
#Shofiqul Alam
If you add any permission in manifest file then forces that only those devices can use this application which have these abilities.
In your case you have added permissions for receiving and sending SMS and for Fine Location
<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_WIFI_STATE"/>
So if the device have not the ability to provide FINE LOCATION then it can't visible on play store. So be sure the device must fulfill the requirement for location(Is device has GPS feature).
If this feature is not compulsory in your app then add the Line of code in your manifest
<uses-feature android:name="android.hardware.location.gps" android:required="false" />
It will not not force the devices to have GPS ability.
Also you may follow the link below:
GPS Manifest: GPS in App is optional, want to make it available to GPS less devices too
As far as I know, permissions do not affect the app's visibility in the Play Store. The <uses-feature> tag will limit visibility (depending if it is required or not).
Also for your app to be visible for tables you must upload some 7" and 10" screenshots.
One last thing, android checks the xml layouts for a tablet-specific file, it had happened to me once that I used the same layout file for both phones and tablets (I did some custom drawing) but I was getting a warning in the play store.
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" />
I developed an android app which shows the caller's Telecom Location on Incoming Call.
I uploaded it on Google Play, but this app does not appear on WiFi only devices, it says your device is not compatible .
My Manifest permission details are below.
<uses-permission android:name="android.permission.READ_CALL_LOG"/>
<uses-permission android:name="android.permission.READ_CONTACTS"/>
<uses-permission android:name="android.permission.WRITE_CONTACTS"/>
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
<uses-permission android:name="android.permission.WAKE_LOCK"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.MODIFY_PHONE_STATE" />
<uses-permission android:name="android.permission.CALL_PHONE" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
I doubt about following permissions
<uses-permission android:name="android.permission.MODIFY_PHONE_STATE" />
<uses-permission android:name="android.permission.CALL_PHONE" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
Which particular permissions are creating problem?
What is the solution.
Thanks
The google play store filters applications based on the permissions they require and the features available in the android device. So, your app will not show up in WiFi only devices because the app requires the CALL_PHONE permisssion and the MODIFY_STATE_PERMISSION.
The MODIFY_PHONE_STATE permission does not allow you to place calls but it implies that telephony is a requirement.
Source : https://developer.android.com/guide/topics/manifest/uses-feature-element.html#permissions
Hence, you should use the <uses-feature> element instead of the above mentioned permissions.
From Docs : You can disable filtering based on the implied feature by explicitly declaring the implied feature, in a element, with an android:required="false" attribute.
In your case :
<uses-feature android:name="android.hardware.telephony" android:required="false" />
But then you also need to ensure that you do not use any of the telephony related features before actually checking if it's available of not.
In the android app, for SDK >=5 , you should use :
PackageManager pm = this.getPackageManager();
boolean hasTelephony = pm.hasSystemFeature(PackageManager.FEATURE_TELEPHONY);
You are correct to suspect the following...
<uses-permission android:name="android.permission.MODIFY_PHONE_STATE" />
<uses-permission android:name="android.permission.CALL_PHONE" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
Certain permissions "imply" the necessity for certain hardware to exist. In other words, permissions relating to the phone require the device to have phone capabilities (obviously).
You can get around this by using the <uses-feature> element in the AndroidManifest.xml. This allows you to specify if the 'feature' is required or not.
Take a look at the documentation for <uses-feature-element>
In particular the Permissions that Imply Feature Requirements section which explains the requirements related to the <uses-permission> elements.
EDIT: One more thing - if a feature CAN be used but it's not REQUIRED, it is up to you to check for its availability in your code before attempting to use it otherwise you'll get unpredictable results or possible exceptions / crashes.
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 Archos tablet which cannot access my app from the Market because it filters it out from the search. The app uses-feature are very unstrict, SDK version should be OK, so I have no ideas what else is missing.
Is there a way to get Market (or 3rd party app/site) to say what hardware/software features are present on device and what are required by Market filters for my app?
my requirements are
<uses-feature android:name="android.hardware.wifi" android:required="true"></uses-feature>
<uses-feature android:name="android.hardware.location" android:required="true"></uses-feature>
<uses-feature android:name="android.hardware.location.network" android:required="false"></uses-feature>
<uses-feature android:name="android.hardware.location.gps" android:required="false"></uses-feature>
<uses-feature android:name="android.hardware.touchscreen" android:required="true"></uses-feature>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"></uses-permission>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"></uses-permission>
<uses-permission android:name="android.permission.INTERNET"></uses-permission>
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"></uses-permission>
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE"></uses-permission>
<uses-permission android:name="android.permission.VIBRATE"></uses-permission>
<uses-permission android:name="android.permission.READ_LOGS"/>
Furthermore, Market says that Archos 101 internet tablet matches, but 70 not (which is basically the same but smaller)
Did you use any telephony features? phone calls/sms? My guess is that the tablet doesn't support such features that causes it to be filtered. to "bypass" that you can try adding this in the permissions
<uses-feature android:name="android.hardware.telephony" android:required="false" />
android:required is set to true implicitly to say that the app cannot function without this permission which should most probably be the reason why the app isn't shown.