'Activity module
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
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 pro As ProgressBar
pro.Initialize("pro")
Dim cmdSubmit As Button
cmdSubmit.Initialize("cmdSubmit")
cmdSubmit.Text = "Submit"
HttpUtils2Service.progressSub = "downloadProgress"
HttpUtils2Service.timerInterval = 200
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.AddView(pro,5dip,5dip,100%x-10dip,20dip)
Activity.AddView(cmdSubmit, 5dip, 30dip, 100%x-10dip,50dip)
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub downloadProgress(tmp As ProgressStatus)
Log(tmp.Downloaded & "/" & tmp.Total)
pro.progress=Round((tmp.downloaded*100)/tmp.total)
End Sub
Sub cmdSubmit_Click
Dim jobPost As HttpJob
jobPost.Initialize("JobPostName",Me)
jobPost.Download("http://ipv4.download.thinkbroadband.com/5MB.zip")
End Sub
Sub JobDone (Job As HttpJob)
Log("JobName = " & Job.JobName & ", Success = " & Job.Success)
If Job.Success = True Then
Select Job.JobName
Case "JobPostName"
ToastMessageShow("Success!", True)
End Select
Else
Log("Error: " & Job.ErrorMessage)
ToastMessageShow("Error: " & Job.ErrorMessage, True)
End If
Job.Release
End Sub