Android Question [SOLVED] Storage for data files

JoeR

Member
Licensed User
Longtime User
My app has data files (.txt or .jpg) which I plan to install/update from my own website.
Where do I install them? I presume it is to File.DirDefaultExternal

Can I (optionally) make them visible when an Android device is "USB connected" to a PC?


-------------------------------------------
For clarity, I have copied below some previous info from Erel.

Files locations - There are several important locations where you can read or write files.

File.DirAssets
The assets folder includes the files that were added with the file manager. These files are read-only. You can not create new files in this folder (which is actually located inside the apk file).

File.DirInternal / File.DirInternalCache
These two folders are stored in the main memory and are private to your application. Other applications cannot access these files.
The cache folder may get deleted by the OS if it needs more space.

File.DirRootExternal
The storage card root folder.

File.DirDefaultExternal
The default folder for your application in the SD card.
The folder is: <storage card>/Android/data/<package>/files/
It will be created if required.
 

JoeR

Member
Licensed User
Longtime User
I have experimented with the above code fragment and it is very helpful.

Can you please explain exactly what I have to do to make the storage visible to browsers.
I have a permission line in my manifest as below - but it does not seem to make any difference.

B4X:
AddManifestText(
<uses-sdk android:minSdkVersion="4" android:targetSdkVersion="14"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<supports-screens android:largeScreens="true"
    android:normalScreens="true"
  then snipped ...
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…