Android Question What storage area is with targetversion 30 available for sharing files between apps

vikingivesterled

Active Member
Licensed User
Longtime User
I'm using the:
SetApplicationAttribute(android:requestLegacyExternalStorage, true)
in the manifest
I'm requesting the:
rp.CheckAndRequest(rp.PERMISSION_READ_EXTERNAL_STORAGE)
and
rp.PERMISSION_WRITE_EXTERNAL_STORAGE

But now with targetSdkVersion="30" and File.DirRootExternal I'm getting the:
open failed: EACCES (Permission denied)
again

I saw in another thread a nessage from Erel that android:requestLegacyExternalStorage was temporary and to use:
rp.GetSafeDirDefaultExternal("")
That gives me:
/storage/emulated/0/Android/data/mobi.moonc.loopdeloop/files
and works for the app, but when I look with a filemanager app in:
/storage/emulated/0/Android/data
there is nothing there.

What storage area can I now use in the app where other apps can see the files.
 

asales

Expert
Licensed User
Longtime User
Check this too:
 
Upvote 1

vikingivesterled

Active Member
Licensed User
Longtime User
Save As will not really do it for automatic saving and retrieveing of system config files that needs to survive if user uninstalls and later reinstalls an app.

If LegacyExternalStorage really is gone its a big problem if files where stored there and a later version of an app no longer can retrieve those files. Very inconsistent of Google. There needed to be a forever period where one could at least read them.
 
Upvote 0

JohnC

Expert
Licensed User
Longtime User
Save As will not really do it for automatic saving and retrieveing of system config files that needs to survive if user uninstalls and later reinstalls an app.
If that is your use-case, then maybe one of these will work:

1) Allow the user to export the settings by creating an email (using email intent) with the config files as attachments sent to the user themself. This way they can import them at a later time.

2) Save the config files to the users "Google Drive". This way they can import them from that too.
 
Upvote 0

vikingivesterled

Active Member
Licensed User
Longtime User
Allowing the user to do something don't mean they will do it.
My experience is that they have no idea they'll change their mind and reinstall the app later when they uninstall it, so will take no precaution for such a case unless forced.
 
Upvote 0

JohnC

Expert
Licensed User
Longtime User
Maybe you could pop up a reminder to save the settings every once in a while (if the settings changes since the last backup) and have a "Backup Now" button on that reminder so it will be a no-brainer for the user do it right then and there.

It's not exactly the solution you are looking for, but maybe it's better than having nothing.
 
Upvote 0
Top