#Region Project Attributes
#ApplicationLabel: B4A Example
#VersionCode: 1
#VersionName:
'SupportedOrientations possible values: unspecified, landscape or portrait.
#SupportedOrientations: unspecified
#CanInstallToExternalStorage: False
#End Region
#Region Activity Attributes
#FullScreen: True
#IncludeTitle: False
#End Region
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 job1, job2, job3 As HttpJob
Dim tijd As Timer
Dim nummer As Int = 0
End Sub
Sub Activity_Create(FirstTime As Boolean)
tijd.Initialize("tijd",10000)
tijd.Enabled = True
job1.Initialize("Job1", Me)
'Send a GET request
'Send a POST request
job2.Initialize("Job2", Me)
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
Dim s As String
s = Job.GetString
If s.Contains ("Welkom") Then
nummer = 0
Log("not good")
Else
Log ("good")
Activity.SetBackgroundImage(Job.GetBitmap)
End If
End Select
Else
Log("Error: " & Job.ErrorMessage)
ToastMessageShow("Error: " & Job.ErrorMessage, True)
End If
Job.Release
End Sub
Sub tijd_Tick
nummer = nummer + 1
Log (nummer)
job3.Initialize("Job3", Me)
job3.Download("http://appie21.com/adri/Erik/" & nummer & ".jpg")
' job3.Download("http://appie21.com/adri/Erik/1.jpg")
End Sub