'Activity module
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
Dim hc As HttpClient
End Sub
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
End Sub
Sub Activity_Create(FirstTime As Boolean)
If FirstTime Then
hc.Initialize("hc")
hc.SetProxy("yourhost", 1111, "http")
End If
End Sub
Sub Activity_Click
Dim req As HttpRequest
req.InitializeGet("http://www.google.com")
hc.Execute(req, 1)
End Sub
Sub hc_ResponseError (Reason As String, StatusCode As Int, TaskId As Int)
Log("Error: " & Reason & " " & StatusCode)
ToastMessageShow("Error", True)
End Sub
Sub hc_ResponseSuccess (Response As HttpResponse, TaskId As Int)
Log("Success")
Log(Response.GetString("UTF8"))
Response.Release
ToastMessageShow("Success", True)
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub