#Region Activity Attributes
#FullScreen: False
#IncludeTitle: False
#End Region
Sub Process_Globals
End Sub
Sub Globals
Private EditText1 As EditText
Private Button1 As Button
Dim job2 As HttpJob
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("test")
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub Button1_Click
Dim name As String = EditText1.Text
If name = "" Then
Msgbox("Please enter Name", "Error")
Return
End If
'Send a POST request
job2.Initialize("Job2", Me)
job2.PostString("http://.............../test.php", "EditText1.Text=name")
' Dim register As HttpJob
' register.Initialize("register", Me)
' register.Download2("http://trycatch.altervista.org/primo.php", _
' Array As String("name", EditText1.Text))
End Sub
Sub JobDone (Job As HttpJob)
Log("JobName = " & Job.JobName & ", Success = " & Job.Success)
If Job.Success = True Then
Select Job.JobName
Case "Job1", "Job2"
'print the result to the logs
Log(Job.GetString)
Case "Job3"
'show the downloaded image
Activity.SetBackgroundImage(Job.GetBitmap)
End Select
Else
Log("Error: " & Job.ErrorMessage)
ToastMessageShow("Error: " & Job.ErrorMessage, True)
End If
Job.Release
End Sub