Android Question [Resolved] Include all files in a subfolder of DirAssets

Joacim

Member
Licensed User
Longtime User
Hi,

I have created a subfolder to the Files folder which I named Levels in which I store a bunch of files that describe the layout of each level in a game. I was wondering how I can make sure these files are included in the APK during compilation or do I have to put all of these files directly in the Files folder and add them that way?
 

pauleffect

Member
Licensed User
Longtime User
pitching in with a suggestion. if you use ps, illustrator or any kind of batch editing tools, might make sure the file extension is also lower-case. You can use this tool to rename, search & replace, change case, so on and so forth in bulk.
And make sure to test both in debugging and release modes. I used to do:
B4X:
LoadBitmap(File.DirAssets, "\folder\file")
Worked in debugging, file no found in release.

Seems eliminating the slash before the folder name fixes this.
Best of luck!
 
Upvote 0

AndrewKing

Member
Licensed User
Longtime User
I just tested it.

This works:
ListSetting = File.ReadList(File.DirAssets, "stage/1.dat")

This failed:
ListSetting = File.ReadList(File.DirAssets, "stage\1.dat")

java.io.FileNotFoundException: stage\1.dat

The difference is "\" and "/"
 
Upvote 0
Top