Android Question File & Directories

luke2012

Well-Known Member
Licensed User
Longtime User
Hi all,
I need to create a directory within the internal storage (filesystem root).
To solve this I'm using:

B4X:
File.MakeDir(File.DirRootExternal, "mydir")

But when within the device is present an SD card the "mydir" is created on the SD card root folder instead internal storage root folder.

My questions:

1) How to (always) point to the internal filesystem?
2) How to prevent the data deletion (data within "myfolder") when the user remove the App* ?

* For example: if I put all my data within the path returned by "File.DirDefaultExternal" method all the data will be deleted when user remove the App.
 

eps

Expert
Licensed User
Longtime User
Can't you set it to use internal storage only use #?

e.g.
#CanInstallToExternalStorage: True or False

What exactly are you trying to achieve?
 
Upvote 0

sorex

Expert
Licensed User
Longtime User
you need to use file.dirInternal to have it stored into your apps data folder.
 
Reactions: eps
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…