'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
Dim hr As HttpRequest
Dim hj As HttpResponse
Dim i As OutputStream
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.
Dim Button1 As Button
Dim ListView1 As ListView
End Sub
Sub Activity_Create(FirstTime As Boolean)
If FirstTime Then
hc.Initialize("hc")
End If
i.InitializeToBytesArray(0)
Activity.LoadLayout("b")
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub hc_ResponseSuccess (Response As HttpResponse, TaskId As Int)
Response.GetAsynchronously("my",i,True,1)
End Sub
Sub hc_ResponseError (Response As HttpResponse, Reason As String, StatusCode As Int, TaskId As Int)
Msgbox(Reason,"s")
End Sub
Sub my_StreamFinish (Success As Boolean, TaskId As Int)
Dim a() As Byte
Dim s As String
a = i.ToBytesArray()
s = BytesToString(a,0,a.Length,"UTF-8")
ListView1.AddSingleLine(s)
End Sub
Sub Button1_Click
hr.InitializeGet("http://192.168.1.5/page_test/curl/login.php")
hc.Execute(hr,1)
End Sub