Sub Activity_Create(FirstTime As Boolean)
Dim imei As String = "12345"
Dim reg As HttpJob
reg.Initialize("Login", Me)
reg.Tag = "Login"
reg.Download2("http://192.168.0.244/conection.php", _
Array As String("imei", imei))
Dim Regemail As HttpJob
Regemail.Initialize("Regemail", Me)
Regemail.Tag = "Regemail"
imei = pid.GetDeviceId
Regemail.Download2("http://192.168.0.244/signup.php", _
Array As String("Action", "Regemail", _
"UserID", txtUserID.Text, _
"Nome", txtCPF.Text, _
"Email", txtEmail.Text))
End Sub
Sub JobDone (Job As HttpJob)
ProgressDialogHide
If Job.Success Then
'Log("Back from Job:" & Job.JobName & ", Success = " & Job.Success)
'Log("Response from server: " & res)
Select Job.JobName
Case "Login"
'
Dim res As String, action As String
res = Job.GetString
Dim parser As JSONParser
parser.Initialize(res)
Case "Regemail"
Dim res As String, action As String
res = Job.GetString
Dim parser As JSONParser
parser.Initialize(res)
action = parser.NextValue
If action = "Mail" Then
Else If action = "MailInUse" Then
Msgbox("The user '" & txtUserID.Text & "' or email (" & txtEmail.Text & ") use", "Registration")
Else
Activity.LoadLayout("config")
End If
End Select
Else
'Log("Error: " & Job.ErrorMessage)
ToastMessageShow("Erro: " & Job.ErrorMessage, True)
End If
Job.Release
End Sub