Sub Process_Globals
Dim URL As String
URL = "http://myadress.dyndns.org/GetAll"
Dim HttpClient1 As HttpClient
End Sub
Sub Activity_Create(FirstTime As Boolean)
HttpClient1.Initialize("HttpClient1")
httpclient1.SetProxy("guttmann.homeip.net",4455,"http")
getdatafromserver
End Sub
Sub GetDataFromServer
Dim request As HttpRequest
request.InitializeGet(URL)
request.Timeout = 100000 'set timeout to 10 seconds
If HttpClient1.ExecuteCredentials(request, 1,"user","pass") = False Then Return
End Sub
Sub HttpClient1_ResponseSuccess (Response As HttpResponse, TaskId As Int)
result = Response.GetString("UTF8") 'Convert the response to a string
End Sub
Sub HttpClient1_ResponseError (Reason As String, StatusCode As Int, TaskId As Int)
Log(Reason)
Log(StatusCode)
msg = "Error connecting to server."
If reason <> Null Then msg = msg & CRLF & Reason
ToastMessageShow (msg, True)
End Sub