Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
Private reqManager As DBRequestManager
Type DBResult (Tag As Object, Columns As Map, Rows As List)
Type DBCommand (Name As String, Parameters() As Object)
End Sub
Sub Activity_Create(FirstTime As Boolean)
If FirstTime Then
reqManager.Initialize(Me, "http://crosswod.duckdns.org:54021/rdc")
End If
Private timer As Timer
timer.Initialize("timer1",5000)
timer.Enabled=True
End Sub
Sub timer1_tick
ProgressDialogShow("Loading...")
Dim cmd As DBCommand
cmd.Initialize
cmd.Name = "select"
reqManager.ExecuteQuery(cmd,0,Null)
End Sub
Sub JobDone(Job As HttpJob)
LogColor(Job.Tag,Colors.Cyan)
If Job.Success = False Then
Log("Error: " & Job.ErrorMessage)
ProgressDialogHide
Else
If Job.JobName = "DBRequest" Then
reqManager.HandleJobAsync(Job, "ReqManager")
End If
End If
Job.Release
End Sub
Sub ReqManager_Result(result As DBResult)
'work with result
reqManager.PrintTable(result)
ProgressDialogHide
End Sub