I want to make a tool for , but I can’t access its directory Com.tool.mobile
in Android/data
Full Path: /Android/data/Com.tool.mobile
Tried Nothing (Because I am new I don’t know much coding.
Q: How to access this specfic folder Com.tool.mobile
of android/data
like this app:
2
Answers
From Android 10 with Scoped Storage if you are targeting to SDK 30 you can’t access to others app’s files even if they are in external storage, at least until you request and got the approval from Google to do so, specifically you will need All Files Access Permission.
To know more see this video resource in YouTube from the official Android Developers channel.
You can temporary opt-out this restriction by setting your target SDK to 29 & using the requestLegacyExternalStorage flag to true in your app manifest, but you will need it to publish your app or app updates in the next November from this link about Google Play’s target API level requirement:
Note: Before doing the request to get the approval from Google to get All Files Access Permission, see if your app really requires this permission, usually it was designed for apps that do files management or backups, and if your justifications is not good enough your request might be rejected.
okay so all of these people saying you cannot access app specific folders, are absolutely wrong, heres how u do it:
Step 1: get the permission of the folder you want,
step 2: write an onactivityresult to get the path
step 3: Get the files one by one from here
and voila, you now have access to that folder using the path saved in shared prefrences