Android Question [SOLVED] Android 10, 11 and Runtime Permissions

SimonInCanada

Member
Licensed User
I have several apps that had to be changed for the Android 6+ runtime permissions and this has been working well so far up to Android 8. My apps all need Android.permission.WRITE_EXTERNAL_STORAGE, android.permission.ACCESS_COARSE_LOCATION and android.permission.ACCESS_FINE_LOCATION.

I see (e.g. https://www.androidauthority.com/android-11-features-1085228/) that Android 10 and 11 are supposed to: .

And further, that article says
Has anybody found they needed to make any changes to their apps to accomodate this?
 

agraham

Expert
Licensed User
Longtime User
This thread summaries the changes you might need to make.
In particular the lack of WRITE_EXTERNAL_STORAGE may cause you problems. Targeting API 30 and above means that if you REALLY need to access outside your protected folders then you will need to use the External Storage class to do so.

Note that if you are not putting your app in the Play Store then you don't need to target above SDK 28 unless you really need to. There is the manifest work around for SDK 29 and in SDK 30 a new MANAGE_EXTERNAL_STORAGE permission that still lets you use legacy external storage access, but this will not be accepted for a Play Store app unless it is really required for the apps main functionality.
 
Upvote 0

SimonInCanada

Member
Licensed User

Thanks. That is very helpful I did try searching before posting but must have used the wrong key words. There are and will only ever be only a few tens of users as the apps are all used to support various low-volume, high value equipment. Hence I often don't even look at Android for months at a time (too busy with embedded stuff).

Simon M
 
Upvote 0

SimonInCanada

Member
Licensed User
Why do you need external storage? Usually you won't need any other than dir.internal. Let the user share the data TO or FROM your app (sarch for examples in the forum).

Thanks. I haven't fully read all of AGraham's links yet but this had already crossed my mind. The original objective of external storage (about 5-6 years ago) was to allow all the app's log data to be written to an SD card because one of the managers thought it would be a good idea and as it was easy to do I did not object. Now, if it is likely to cause any problems now or in the future, the simplest solution is probably just to move it to internal and instruct the users to offload any existing data before upgrading.

I am unsure what you mean by letting users share data TO and FROM our app(s). I did search for examples but they seemed to be about using SQL Lite?

Simon M
 
Upvote 0

SimonInCanada

Member
Licensed User

Thanks. That's interesting. For my immediate requirements however, the only reason the apps are using the WRITE_EXTERNAL_STORAGE permission is to save log and setup data to an SD Card rather than the phone's internal storage; a management decision made years ago and not really necessary now, if it ever was. So I am going to go with your first idea of using internal storage.

Simon M
 
Upvote 0

SimonInCanada

Member
Licensed User
Thanks to everyone who has replied so quickly and given me pointers to such great information. I think I understand the options now

Simon M
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…