Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
Dim Timer1 As Timer
Dim Timer2 As Timer
Dim Timer3 As Timer
Dim Timer4 As Timer
End Sub
Sub Globals
Dim clv1 As ListView
Dim clv2 As ListView
Dim myProgressDialog As CustomProgressDialog
Dim Label2 As Label
Dim Label3 As Label
Dim Label5 As Label
Dim Name_door As String=""
Dim VerStatus As String
Dim sf As StringFunctions
Dim status As String="0"
sf.Initialize
Private link As String = "http://192.168.168.182:25750"
Private raf As RandomAccessFile
Type SectionLocation (Name As String)
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("1")
raf.Initialize(File.DirInternalCache, "temp", False)
If FirstTime Then
Timer1.Initialize("Timer1",1000)
Timer2.Initialize("Timer2",1000)
Timer3.Initialize("Timer3",2500)
Timer4.Initialize("Timer4",2500)
End If
Timer1.Enabled=True
Timer2.Enabled=False
Timer3.Enabled=False
Timer4.Enabled=False
VerStatus=" Status: Checking App Version..."
End Sub
Sub SendObject (Obj As Object)
raf.WriteObject(Obj, True, 0)
Dim size As Int = raf.CurrentPosition
Dim data(size) As Byte
raf.CurrentPosition = 0
Do While raf.CurrentPosition < size
raf.ReadBytes(data, raf.CurrentPosition, size - raf.CurrentPosition, _
raf.CurrentPosition)
Loop
Dim j As HttpJob
j.Initialize("send object", Me)
j.PostBytes(link & "/Section_Location", data)
End Sub
Sub GetName(strName As String)
Name_door=strName
Dim a As SectionLocation
a.Initialize
a.Name=strName
SendObject (a)
End Sub
Sub JobDone(j As HttpJob)
If j.Success Then
If j.JobName = "send object" Then
Log(j.GetString)
End If
Else
Log("Error: " & j.ErrorMessage)
Msgbox(j.ErrorMessage, "Error")
End If
j.Release
ProgressDialogHide
End Sub