Reputation: 482
i have a project in eclipse with some permissions, when i run this project in eclipse and device is upgraded to Android M, then the permissions of the app are enable by default.(go to settings->apps->your app->permissions, all are enabled) but when i run in Android studio the permissions are disabled by default. any solutions for this.(go to settings->apps->your app->permissions, all are disabled)
Upvotes: 1
Views: 1303
Reputation: 482
Finally solved this, it is because if your targeted sdk version is set to 23 then all your all permissions will be disabled by default, thats what happening with me because my Android studio targeted version was set to 23 and in my eclipse it was 21, so if you set your targeted version less then 23 your permissions will be Enabled by default and if greater or equal to 23 then permissions disabled by default.
Upvotes: 1
Reputation: 1505
You shouldn't ask for permissions, which you don't use. That's why in Android Studio permissions are disabled by default. But you can add permissions in your manifest
file with tag <uses-permission>
, for example
<uses-permission android:name="android.permission.INTERNET" />
Place it before your <application>
tag
Upvotes: 1