jimmyF Active Member Licensed User Longtime User May 17, 2019 #1 I have created my first library with the "Compile To Library" command. I make use of the B4XPreferenceDialog in the Class modules. Actually, the log error is the following: B4X: Initialize: java.io.FileNotFoundException: /data/user/0/sef.test/files/virtual_assets/listtemplate.bal (No such file or directory) This is not a file that I use. btw, there was nothing found in my forum searches. Last edited: May 17, 2019
I have created my first library with the "Compile To Library" command. I make use of the B4XPreferenceDialog in the Class modules. Actually, the log error is the following: B4X: Initialize: java.io.FileNotFoundException: /data/user/0/sef.test/files/virtual_assets/listtemplate.bal (No such file or directory) This is not a file that I use. btw, there was nothing found in my forum searches.
Star-Dust Expert Licensed User Longtime User May 17, 2019 #2 https://www.b4x.com/android/forum/threads/embedding-files-in-compiled-libraries.37689/ Upvote 0
jimmyF Active Member Licensed User Longtime User May 18, 2019 #3 So, I am trying to load this file (I can see it in the jar(zip) file.): B4X: prefdialog.LoadFromJson(File.ReadString(File.DirAssets, "login.json")) I have tried this but it tells me it is missing a parameter. B4X: Dim sFile As String = File.DirAssets & "login.json" prefdialog.LoadFromJson(File.ReadString(jf1.LoadFileFileFromJar(sFile))) Upvote 0
So, I am trying to load this file (I can see it in the jar(zip) file.): B4X: prefdialog.LoadFromJson(File.ReadString(File.DirAssets, "login.json")) I have tried this but it tells me it is missing a parameter. B4X: Dim sFile As String = File.DirAssets & "login.json" prefdialog.LoadFromJson(File.ReadString(jf1.LoadFileFileFromJar(sFile)))
DonManfred Expert Licensed User Longtime User May 18, 2019 #4 try B4X: Dim sFile As String = "login.json" prefdialog.LoadFromJson(jf1.LoadFileFileFromJar(sFile)) Upvote 0
jimmyF Active Member Licensed User Longtime User May 18, 2019 #5 DonManfred said: Dim sFile As String = "login.json" prefdialog.LoadFromJson(jf1.LoadFileFileFromJar(sFile)) Click to expand... When jf1.Initialize(True): java.lang.RuntimeException: JSON Object expected. When jf1.Initialize(False): Too many errors with the loading of the B4XPreferencesDialog. I will drop this idea of compiling it into a library and simply use the classes I wrote directly in my apps. That way they work just fine. Many thanks for your help. -j Upvote 0
DonManfred said: Dim sFile As String = "login.json" prefdialog.LoadFromJson(jf1.LoadFileFileFromJar(sFile)) Click to expand... When jf1.Initialize(True): java.lang.RuntimeException: JSON Object expected. When jf1.Initialize(False): Too many errors with the loading of the B4XPreferencesDialog. I will drop this idea of compiling it into a library and simply use the classes I wrote directly in my apps. That way they work just fine. Many thanks for your help. -j
Erel B4X founder Staff member Licensed User Longtime User May 19, 2019 #6 You should create a b4xlib. It is a matter of creating a zip file with the modules. Unzip XUI Views.b4xlib for an example. Upvote 0
You should create a b4xlib. It is a matter of creating a zip file with the modules. Unzip XUI Views.b4xlib for an example.