Android Question Confused about where to put files externally so they can be found.

MrKim

Well-Known Member
Licensed User
Longtime User
As I understand it the only "safe" place to put files external from my application is in GetSafeDirDefaultExternal or a sub of that.

The problem I am having is that - at least on my pixel 3 that directory is buried so deep it is almost impossible to find, it doesn't even show up in any searches using various apps.

The ONLY way I am able to get at the file - and this took me the better part of an hour to find:

Open Settings.
Open Storage
Open Files
Open the android folder
Find and open the folder that was created using the package name from build configuration
open the files folder

Even the Files by Google app cannot access or find the files I copy from my app.

So while I am looking at all of this I am finding that many other apps seem to be able to create directories and put files in them that are MUCH higher up the tree, and much easier to find. Even I have been able to copy and move files - even from my computer - that are more easily accessible.

I also see a class called FileProvider but that appears to have to do with intents?

Any enlightenment on this would be greatly appreciated.
 

Brian Dean

Well-Known Member
Licensed User
Longtime User
I also see a class called FileProvider but that appears to have to do with intents?
Yes - File Provider does use intents but you do not have to get involved with intents yourself.

Download the example application from this link and you will see how to use it.
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
Another option is to make your app a "picker" app: https://www.b4x.com/android/forum/threads/sharing-files-from-your-app-with-file-provider.70458/

So while I am looking at all of this I am finding that many other apps seem to be able to create directories and put files in them that are MUCH higher up the tree, and much easier to find.
That's currently possible with the requestLegeacyExternal option: https://www.b4x.com/android/forum/threads/android-jar-targetsdkversion-minsdkversion.87610/
 
Upvote 0
Top