'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 Url As String
Dim HttpClient1 As HttpClient
Url = "http://tinygeocoder.com/create-api.php?g="
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 btnFind As Button
Dim lblResults As Label
Dim txtLongLat As EditText
End Sub
Sub Activity_Create(FirstTime As Boolean)
If FirstTime Then
HttpClient1.Initialize("http")
End If
Activity.LoadLayout("mainscrn")
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub btnFind_Click
Dim HttpResponse1 As HttpResponse
Dim request As HttpRequest
If txtLongLat.Text="" Then
Msgbox("Please enter long,lat","Error")
Return
End If
LblResults.Text=""
request.InitializeGet(Url & txtLongLat.Text)
request.Timeout=30000
If HttpClient1.Execute(request, 1) = False Then Return
ProgressDialogShow("Please wait...Searching")
End Sub
Sub Http_ResponseSuccess (Response As HttpResponse, TaskId As Int)
ProgressDialogHide
lblResults.Text = Response.GetString("UTF8")
End Sub