Home > Back-end >  Access files of another App inside the Download folder - Android 10
Access files of another App inside the Download folder - Android 10

Time:10-17

Trying to make some sense of this complete mess of scoped storage.

So I'm storing some files (logs) generated by App A inside the Download folder.

I'm using Mediastore/ContentResolver and no problems with that either for read or write access as long as it's from App A.

But then App B needs to read these files and here comes the problem. Same way using Mediastore/ContentResolver but the files seem invisible for queries.

Download is supposed to be a Shared Storage, but files are indeed generated as -rw-rw--- which means no permission for others which could explaind why App B does not sees files from App A if they are not in the same group.

Would the Storage Access Framework method work around this? Thi not tried it yet because poping system window's is definitely not something I wanted as a user experience for my App.

Thanks.

CodePudding user response:

If the second app has 'all files access' with MANAGE_EXTERNAL_STORAGE it can also list the files of the first app.

Otherwise you can let the user of the second app pick those files with ACTION_OPEN_DOCUMENT of Storage Access Framework.

You better store your files in a sub directory as then second app can pick complete directory with ACTION_OPEN_DOCUMENT_TREE and list all the files.

  • Related