Android Question Shared code between B4i and B4A using HttpJob

Alberto Iglesias

Well-Known Member
Licensed User
In the process to share my code between this platforms, I have to know what's the best practice to
create some method on a function on Code Module or b4xLib to use httpJob or other process to download, like this

B4X:
Dim j As HttpJob
j.Initialize("", Me)
j.Download("https://www.google.com")
Wait For (j) JobDone(j As HttpJob)
If j.Success Then
   Log(j.GetString)
End If
j.Release
in Code Module we can't use "me" to receive the response, I'm thinking in use b4xlib, or have another best practice to create this???

thank you
 

DonManfred

Expert
Licensed User
I have to know what's the best practice to
create some method on a function on Code Module
do not use Codemodules for httpjobs.

Create a class and use the Class from Services/Activities. In regard to b4i i expect the best solution is a Class which can be used in B4A/B4i (and also B4J btw).

You even could create a b4xlib (which can be used in all platforms).
 
Last edited:
Top