1

I am not really an expert in android development so please bear with me.

I am to change an app from Android 19 to 23. Android API 23 changed the way the permissions work. So what happens in API 23 is that instead of asking the permissions in the App installation, it asks for permission on run time.

My question is will I need to change anything to the way my permission is set in the Andoid manifest? because I tried to change the API to 23 in the build.gradle and everything seems to still work with no differences.

Angelo Charl
  • 347
  • 4
  • 15

2 Answers2

4

My question is will I need to change anything to the way my permission is set in the Andoid manifest?

There is nothing that you have to do. If there are permissions that you only want to use on API Level 23+ devices, you can use <uses-permission-sdk23> instead of <uses-permission>, but that is entirely optional.

because I tried to change the API to 23 in the build.gradle and everything seems to still work with no differences.

I do not know what "change the API to 23" means. If your targetSdkVersion is 23 or higher, and you are running on API Level 23 or higher (Android 6.0+), and you install the app normally (i.e., not by running it from development tools), the user will no longer be prompted for permissions at install time. However, for any permissions with a protectionLevel of dangerous that you request (e.g., WRITE_EXTERNAL_STORAGE), you will not hold those permissions until you request them at runtime and the user grants them.

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
  • Sorry to be inaccurate but yeah you are right. I changed the **targetSdkVersion** and the **minSdkVersion** to 23. Thanks, I now understand the difference. I thought Adding the permission in the manifest automatically asks for the permission every time a feature will be used. It seems like I needed to add the permission checks in the java code. – Angelo Charl Sep 07 '16 at 13:52
-1

No. The targetSdkVersion, minSdkVersion etc you set in your code has no effect on how permissions are handled, rather are dependent on which device the target app is running. Android changed the way permissions are to be asked in Android 6.0(API 24 devices). You have to make ask for permissions at runtime. Official Documentation for asking runtime permissions from user.

Aman Grover
  • 1,621
  • 1
  • 21
  • 41