Android Question Two methods to place files into assets

b4auser1

Well-Known Member
Licensed User
Longtime User
The files *.bal are shown in the IDE in the Panel Files and get into the assets folder in an apk.
I also placed *.html files into the project_folder\Files folder and they get into the assets folder in an apk as well.
What in the diffrence between simple copying files to project_folder\Files folder and attaching them into the Panel Files in the IDE ?
 

NJDude

Expert
Licensed User
Longtime User
When you add the files using the IDE you are "telling" the system which files are required for your app. Just make sure that you only add (or copy) the files you need otherwise you will be adding unnecessary files to the APK.
 
Upvote 0

warwound

Expert
Licensed User
Longtime User
If you simply copy files to the Files folder without using the IDE, and now export your project as a zip file, the zip file won't contain these manually added files.

Martin.
 
Last edited:
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
You should add all the files that your project depends on to the Files tab. The IDE needs to know which files are required for your project.

You will see warnings (Logs tab) about files missing from the Files tab. When you add files to the Files tab the files are lower cased automatically. Non-lower cased files cannot be loaded at runtime.
 
Upvote 0

b4auser1

Well-Known Member
Licensed User
Longtime User
Thank you, guys for explanations.

So if I understand correctly:

IDE in any case will copy all the files from the Files folder to the assets folder in the apk, whether they are added to the Files tab or not
i.e.

If the files are copied to the Files folder and added to the Files tab, then IDE will
1) copy the files from the Files folder to the assets folder in the apk.
2) make them lower cased automatically
3) raise warnings (Logs tab) about files missing from the Files tab

If the files are copied to the Files folder but not added to the Files tab, then IDE will
1) copy the files from the Files folder to the assets folder in the apk.
2) not make them lower cased automatically
3) not raise warnings (Logs tab) about files missing from the Files tab
 
Upvote 0

warwound

Expert
Licensed User
Longtime User
If the files are copied to the Files folder but not added to the Files tab, then IDE will:

NOT include these files in any zip file you create if you export your project as a zip file.
Sounds very unimportant but might catch you out at a later date .

Martin.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…