Where do the resources on the Files tab get put?

gregmartin64

Member
Licensed User
Longtime User
When you add text files to the files list as a resouce. Where are they deployed on the phone?

I presumed they'd be under the application names folder but that doesn't seem the case.

For example, I have included a file called list0990.txt in my files tab and then run the app, where is the file pushed to by default?

Hope that makes sense.

Thanks.
 

Alex Chan Chee Wah

Member
Licensed User
Longtime User
Hi Guys,

I have being trying to add some mp3 files into the files tab, and in my codes i will only load them when I need to play this wave files.
the problem is that it never get installed together with the apk and not found in the dirAsset directory at all.

Also I have tried using the #AdditionalRes but during compilation, it will throw out exception of "invalid resource directory name". Below is the compilation result

Parsing code. 0.07
Compiling code. 0.24
Compiling layouts code. 0.01
Generating R file. Error
invalid resource directory name: c:\v/1.mp3
invalid resource directory name: c:\v/2.bid.mp3

And my code to include the result is "#AdditionalRes: c:\v"

Can anyone advise how should I do it to include the mp3 files into the dirAsset directory during the apk installation?

Thanks in advance.

Regards,
Alex Chan
 
Upvote 0

klaus

Expert
Licensed User
Longtime User
invalid resource directory name: c:\v/1.mp3
It seems that you are trying to acces the files from folder c:\v/ ?
First point you have a backslash and a slash in the file name !?
This folder is on the PC and not on the device !
If you want to have mp3 files in the DirAssets folder you must add them in the Files tab.
They will then be included in the apk file which may become quite hudge.
If you have many mp3 files it will last some time to load the apk file onto the device.
 
Upvote 0

Alex Chan Chee Wah

Member
Licensed User
Longtime User
Hi,
As mentioned, I have tried to include these mp3 files under the files tab before. But after compile and installation there is no sight of these mp3 files being installed in the DirAsset folder or even in the device. This is because I do a full system file search for the mp3 files. That's why I try the #AdditionalRes method.

As you can see from my sample code "#AdditionalRes: c:\v", I didn't include the / in the declarations, but it is being appended and displayed by the compiler during compilation.

Have tried also to to project clean up but the problem still persist.

One point I noticed is that during compilation if I include these mp3 files under the Files tab, it will shows "1.mp3 file is not used anyway"... something like that. Does that means with that statement, it will not include into the apk during compilation?

For these mp3 files, my code will initialise a mediaplayer and check for these file exists before loading them.

Please help me on this issue as i have been trying all the possible code given in this forum, but still no avail.
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
Copy the files in the FILES folder under your projects path...

C:\b4a\yourapp.b4a -> C:\b4a\files\
Copy all mp3´s into this folder. Then do a install of this app. Maybe you must deinstall the old one and make a fresh install...

The mp3-files out of the files-folder should then be accessible/exists in DirAssists
 
Upvote 0

Alex Chan Chee Wah

Member
Licensed User
Longtime User
Dear Manfred,

I have tried your method (copy the mp3 files into my project folder\files directory, include them under the Files tab and uninstalling my apps first).
But still not sight of the files.

May I know after the installation, where should my apps directory should be? is it under the /mnt/internal/andriod/data/MyApps/files?
or somewhere else?

Please advise.

Thanks in advance.
 
Upvote 0

Alex Chan Chee Wah

Member
Licensed User
Longtime User
Virtual directory, so I suppose we can see them in the file manager in ky installed device?
Also means we will not able to see the mp3 files even if my apps installed successfully?
Please advise, as I have follow the instructions to includes allmy mp3 files under the files tab, but still didn't see these files.
 
Upvote 0

Alex Chan Chee Wah

Member
Licensed User
Longtime User
Hi Guys,

Once again thanks for your supports and suggestion.
I confirmed that the files are correctly loaded into the DirAsset folder which is not visible to device's file manager.

I hope this confirmation to clarify the same situations to the newbies like me.

Thanks.
 
Upvote 0
Top