Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Dim ConnexioInternet As String
Dim no_intenet As String = "<center><h1>No Internet</h1></center>"
End Sub
Sub Activity_Create(FirstTime As Boolean)
'Do not forget to load the layout file created with the visual designer. For example:
'Activity.LoadLayout("Layout1")
Dim myw As WebView
myw.Initialize("myw")
Activity.AddView(myw, 0, 0, 100%x, 100%y) 'Your options for size here
Log("Will check internet now")
CheckInternet
If ConnexioInternet = "value is 5" Then
Log("Internet: 1")
myw.LoadUrl("http://www.stackoverflow.com")
Else
Log("Internet: 0")
myw.LoadUrl($"no_internet"$)
End If
End Sub
Sub CheckInternet
Dim j As HttpJob
j.Initialize("JobA", Me)
j.Download("http://bixma.com/test_value.txt")
Wait For (j) JobDone(j As HttpJob)
Select j.JobName
Case "JobA"
If j.Success Then
ConnexioInternet = j.GetString
Log(ConnexioInternet)
End If
End Select
j.Release
End Sub