why are you changing the standard b4a context?
the error you get is very clear:
change your class to this:
Public Sub initialize
download
End Sub
Public Sub download
Private http As HttpJob
http.Initialize("http",Me)
http.Download("https://cdn.shortpixel.ai/client/q_glossy,ret_img/https://www.b4x.com/basic4android/images/dopus_NucbTJkLV0.png")
Wait For (http) JobDone(j As HttpJob)
If j.Success Then
Log("yes")
Else
Log("no")
End If
j.Release
End Sub
call the class like this:
Private a As MyLibrary
a.initialize