Sub Process_Globals
Dim hc As HttpClient
End Sub
Sub Globals
End Sub
Sub Activity_Create(FirstTime As Boolean)
If FirstTime Then
hc.Initialize("hc")
End If
Dim req As HttpRequest
req.InitializeGet("http://www.b4x.com/android/images/logo.png")
hc.Execute(req, 1)
End Sub
Sub hc_ResponseSuccess (Response As HttpResponse, TaskId As Int)
Dim b As Bitmap
b.Initialize2(Response.GetInputStream)
Activity.SetBackgroundImage(b)
Response.Release
End Sub
Sub hc_ResponseError (Response As HttpResponse, Reason As String, StatusCode As Int, TaskId As Int)
Log("Error connecting: " & Reason & " " & StatusCode)
If Response <> Null Then
Log(Response.GetString("UTF8"))
Response.Release
End If
End Sub