B4J Question [SOLVED] B4j Packager and install aplication folders

inakigarm

Well-Known Member
Licensed User
Longtime User
Hi:

I've an UI B4J aplication on Windows that has several data folders and it's working ok on folders on DirApp folder running the jar file directly.

Now, I want to use B4J Packager to create an installation package of my aplication (tested yesterday and works fine) and I'd like to ask which is the best approach to mantain the data folder structure.

1. ZIP the folder, rename to jar and access like a library from B4J aplication (https://www.b4x.com/android/forum/threads/solved-add-files-sub-directories-to-app.80818/)
2. If it's possible to have subfolders on DirAssets and copy to DirData on first program run; it seems that this option (https://www.b4x.com/android/forum/threads/folders-inside-files-folder-of-the-project.64128/#content) could be available in some point of B4J upgrades, -don't know if it's available on last ver BJ5.90.
3. Do someone use another option to achieve this result?

Thanks
 

inakigarm

Well-Known Member
Licensed User
Longtime User
Well, I don't know if I'm doing something wrong with Option 1 but can't access the files on the created jar; I've tested all the ways: maybe I've missed on step

1) Creating a Files folder and copying the contents of the desired resources on it:
Files
|______mp3
|______test1.mp3


2) Zipping this Folder: Files.zip
3) Renaming to, for ex: mp3.jar

4) Adding #AdditionalJar: mp3

5)
B4X:
Log("File exists= " & File.Exists(File.DirAssets, "mp3/test1.mp3"))
returns File exists= False ---

P.D: Seems that it File.exists can't be used with DirAssets folder.


6) Loading the resource directly to mediaplayer


B4X:
Dim mp as Mediaplayer
mp.Initialize("mp", File.GetUri(File.DirAssets, "mp3/test.mp3"))
works !
 
Last edited:
Upvote 0
Top