Android Question ExternalStorage difference between targetSdkVersion 29 and 30

andredamen

Active Member
Licensed User
Longtime User
I use ExternalStorage and there is no problem when I use targetSdkVersion 29. But when I set targetSdkVersion to 30 the browser shows all the folders on my phone but there is no permission to go into the folders.

Is there a difference in use ExternalStorage when in targetSdkVersion 30? How can I solve this because in november 2021 I must us sdk 30?
 

drgottjr

Expert
Licensed User
Longtime User
we have been warned here for months (if not years) about not using
external storage and the changes that are required for those who did.

as for sdk30, you need to target it if your app is listed at play.
in addition you will run into a number of problems regarding where you
store your files. you will need to learn about tools which google has
provided to deal with accessing resources outside of your app's asset
folder and the so-called file.dirinternal folder. they are all addressed here
in the forum.

if you target sdk30 and your app is not listed at play,
you can request access to external storage by adding
B4X:
SetApplicationAttribute (android: requestLegacyExternalStorage, true)
to your manifest (not to mention the usual runtime permission to
access external storage). note: if you try this with an app destined for play,
you'll receive a friendly letter from google asking you to step into the back
room for some questioning. your story had better be good.

neither the legacy access request nor the runtime permission will be
recognized for android 11...
 
Upvote 0

agraham

Expert
Licensed User
Longtime User
 
Upvote 1
Top