Reputation: 161
I built an application that uses the following permissions:
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE"/>
<uses-permission android:name="android.permission.CHANGE_NETWORK_STATE"/>
<uses-permission android:name="android.permission.READ_PHONE_STATE"/>
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
When i try to install it manually on my android device (Android version 6.0.1) i get the following message:
Do you want to install this application? it does not require any special access.
But in fact it does require some special accesses, by the way, when i test on Devices with android 5.1 and prior, i was shown the permissions and asked to accept them.
this is a problem because i have to manually toggle the permissions on in the android settings in application management when on android 6.0.1 so the application works normally.
is there anything i have to add to my code to fix the issue for android 6+ ?
Another strange issue i noticed, at the page of my application on Playstore (close alpha testing for now) i get the following message in Permission details under developer section:
Item not found.
and this i get only on my android 6.0.1 device, and not in devices with prior versions.
Upvotes: 0
Views: 3699
Reputation: 1463
You need to ask for permissions at runtime in android 6+. This is the reason why no permission is asked when you are installing your application like its asking in android lollipop. Visit android developer page to learn how to ask for permission for android M and above visit : https://developer.android.com/training/permissions/requesting.html
Upvotes: 1
Reputation: 2117
Because the android M permission handle it differently, you need to ask the permissions at runtime Take a look here : https://developer.android.com/training/permissions/requesting.html
Upvotes: 2