Creating files external but part of the app

zxxdaro

Member
Licensed User
Longtime User
I am new to all of this so I may be making some fundamental error of how things work. If I am then please correct me.

I want to write an application which contains some data files. These are read by the application. So far I can find lots of things about how files are read from and written to but nothing about how, withing the system of writing and emulation, one creates files which are to go with the application and which are to be stored with it.

Could someone please tell me how one goes about doing this. I have seen certain references to a "file manager" but I am not entirely sure if they are relevant or not.
 

kickaha

Well-Known Member
Licensed User
Longtime User
If you have data files that your app needs you can include them with the app.

Select the "Files" tab on the right hand side of the B4A IDE and click on the Add Files button to add them. They can be read by the app using File.DirInternal as the directory and the filename as the filename (sorry - that sounds so condescending).

This is only applicable to files that you want to read - if you need to modify them within the app then you would need to copy them to another location first.
 
Upvote 0

klaus

Expert
Licensed User
Longtime User
For the files added with the file manager in the IDE, the directory to access thes files is File.DirAssets and not File.DirInternal.
Be aware that files in the DirAssets directory are read only.
If you need to write to these files you must copy them to another directory for example File.DirInternal.

Best regards.
 
Upvote 0
Top