Hi @Earl, I am currently working on building a cross-platform project for B4A and B4J. Previously, I had completed the same project fully for B4A and it had good results. When I decided to work on the project for Windows, I used B4X instead. The issue I am facing is with retrieving data from an online database, which accounts for almost 90% of my project. In B4A , I used the FastNet library which allowed me to quickly retrieve data from the database, even when there were over 1000 fields in a table. However, this library does not exist for B4J. Therefore, I was forced to use the jokhttputlis2 library, which has two fundamental issues for B4J. Firstly, it takes approximately half a second to retrieve and save data offline for each ID, and if the internet speed is slow, it could take longer. Secondly, while retrieving data online, no other thread can be performed, and the program becomes unresponsive until all data is retrieved. I was wondering if there is any way to use a library similar to FastNet within B4J, which allows for quick retrieval of all data from an online database.
Wait For:
jb_amar.PostString("http://example.com/upload_amar.php","")
Wait For JobDone (job As HttpJob)
If job.Success Then
Upload(job)
Else
log("Not Success")
End If
job done sub:
Sub Upload (job As HttpJob)
If job.GetString = Null Then
log("Null")
Else
js_amar.Initialize(job.GetString)
map_amar = js_amar.NextObject
list_amar = map_amar.Get("result")
For Each row As Map In list_amar
If Deletecount = False Then
sql_amar.InitializeSQLite(File.DirApp&"/data/", "db.db", True)
sql_amar.ExecNonQuery("DELETE FROM tbl")
sql_amar.Close
End If
Deletecount=True
id = row.Get("id")
user = row.Get("user")
line = row.Get("line")
working = row.Get("working")
recovery = row.Get("recovery")
If sql_amar1.IsInitialized = False Then
sql_amar1.InitializeSQLite(File.DirApp&"/data/", "db.db", True)
End If
sql_amar1.ExecNonQuery("INSERT INTO tbl (id,user,line,working,recovery) VALUES ('"&id&"','"&user&"','"&line&"','"&working&"','"&recovery&"')")
Log(id)
Next
sql_amar1.Close
num = num + 0.4
ProgressBar1.Progress = num
Log("Frist Upload"&ProgressBar1.Progress)
Deletecount=False
End If
End Sub
Last edited: