I'm trying to write a class to check if internet connection is available. Code is
But not working while I'm trying to use it.
Please help me to understand the error.
B4X:
'Class module
Sub Class_Globals
End Sub
'Initializes the object. You can add parameters to this method if needed.
Public Sub Initialize
End Sub
Public Sub Status As Boolean
Dim P As Phone
If (P.GetDataState == "CONNECTED" ) Then
Return True
End If
End Sub
But not working while I'm trying to use it.
B4X:
Dim net As Connection
If net.Status = True Then
Msgbox("Connected", "")
Else
Msgbox("No Connection", "")
End If
Please help me to understand the error.