I have written a sub that checks whether I have network connectivity - either via a local network, or a cell network:
The problem I am having is that I am receiving the following error report from a few of my users:
What I don't understand is where this "Invalid int:" is coming from. There are no int variables in the sub & none of the method calls take an int as a parameter, nor do they return an int. I also don't know where this " 4" value is coming from. Is this possibly a bug in the Network library, or am I missing something really obvious here?
Thanks,
Colin.
B4X:
Sub Check_Connectivity() As Boolean
Dim phDevice As Phone
Dim sTCP As ServerSocket
Try
sTCP.Initialize(13132, "")
If sTCP.GetMyIP <> "127.0.0.1" Then
sTCP.Close
Return True
End If
sTCP.Close
If phDevice.GetNetworkType <> "UNKNOWN" Then Return True
Return False
Catch
Send_Error_Report("Check_Connectivity", LastException.Message)
Return False
End Try
The problem I am having is that I am receiving the following error report from a few of my users:
Yahtzee! Version: Version: 10.4 (Free)
SDK: 16
Sub: Check_Connectivity
Error: java.lang.NumberFormatException: Invalid int: " 4"
Timestamp: 01/27/2014 - 13:20:43
What I don't understand is where this "Invalid int:" is coming from. There are no int variables in the sub & none of the method calls take an int as a parameter, nor do they return an int. I also don't know where this " 4" value is coming from. Is this possibly a bug in the Network library, or am I missing something really obvious here?
Thanks,
Colin.