Sub Globals
Dim MyLan As ServerSocket ' Network Library - for detecting IP
End Sub
Sub Activity_Create(FirstTime As Boolean)
If FirstTime then MyLan.Initialize(0, "")
End Sub
Sub Activity_Resume
If MyLan.IsInitialized Then CheckWiFi
End Sub
Sub CheckWiFi
Dim p As Phone 'Phone Library
If p.GetSettings ("wifi_on") <> 1 Then
MsgBox ("WiFi is OFF","")
Else 'WiFi is on
If p.GetDataState = "DISCONNECTED" Then ' Phone carrier's data network is disconnected
MsgBox ("WiFi is ON and CONNECTED","")
Else
MsgBox ("WiFi is ON but NOT connected to a WiFi network","")
End If
End If
End Sub