Beginning in Android 6.0 (API level 23), we can ask permissions at run time. However, according to the docs, all permissions still need to be defined in AndroidManifest.xml so in APIs lower than 23, these permissions will be granted prior to installing the app.
I want to request ACCESS_FINE_LOCATION
permission only at runtime - since this is a sensitive permission, requesting it prior to installation without any context will cause a decrease in downloads.
I am targeting my app to API levels 11+, so I wonder whether it is possible not to ask for the ACCESS_FINE_LOCATION
permission in older APIs (i.e. not list it in AndroidManifest for APIs older than 23), and only request it for APIs 23+.
Update
For clarification, I want to know whether it is possible to do the following:
AndroidManifest.xml
IF API_LEVEL>=23: {
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
}
ELSE:
{
}
I think you can do this using:
<uses-permission-sdk-23 android:name="string" android:maxSdkVersion="integer" />
You can read more about it in the official documentation: uses-permission-sdk-23
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With