When I turn on 4G and wifi off, I need a way to detect, if a network connection is available.
I need to know the 4G IP address
This seems like an universal need for any synching between the local device database and a server.
Sub Class_Globals
Dim myLan as serversocket
end sub
Sub PingServer as boolean
dim oPhone as phone
if oPhone.IsAirplaneModeOn=True then
bRetVal=false
return(bRetVal)
end if
dim sDeviceIP as string
sDeviceIP=myLan.GetMyWifiIP
if sDeviceIP="127.0.0.1" then
bRetVal=false
return(bRetVal)
end if
if oPhone.GetSettings("wifi_on")<>1 then
bretval=false
return(bRetVal)
end if
if oPhone.GetDataState="DSCONNECTED" then
bRetVal=True
else
bRetVal=false
end if
return(bRetVal)
end sub
I need to know the 4G IP address
This seems like an universal need for any synching between the local device database and a server.
Sub Class_Globals
Dim myLan as serversocket
end sub
Sub PingServer as boolean
dim oPhone as phone
if oPhone.IsAirplaneModeOn=True then
bRetVal=false
return(bRetVal)
end if
dim sDeviceIP as string
sDeviceIP=myLan.GetMyWifiIP
if sDeviceIP="127.0.0.1" then
bRetVal=false
return(bRetVal)
end if
if oPhone.GetSettings("wifi_on")<>1 then
bretval=false
return(bRetVal)
end if
if oPhone.GetDataState="DSCONNECTED" then
bRetVal=True
else
bRetVal=false
end if
return(bRetVal)
end sub