Hello,
I am facing one issue is that , if GPS Turn OFF, the position is activated and I must have to clear cache for reset.
As when the internet is OFF, then I am turning OFF the GPS.
But when I am making the Internet available [ON] then all the GPS data coming that has been stored in GPS cache during Internet Unavailability.
Below is the code base where I am turning OFF the GPS service....
Could you please advice as how to clear the GPS cache when the internet is not available.
Thanks
I am facing one issue is that , if GPS Turn OFF, the position is activated and I must have to clear cache for reset.
As when the internet is OFF, then I am turning OFF the GPS.
But when I am making the Internet available [ON] then all the GPS data coming that has been stored in GPS cache during Internet Unavailability.
Below is the code base where I am turning OFF the GPS service....
B4X:
Sub PhoneEvent_ConnectivityChanged(NetworkType As String, State As String, Intent As Intent)
'NetworkType - WIFI or MOBILE.
'State - One of the following values: CONNECTING, CONNECTED, SUSPENDED, DISCONNECTING, DISCONNECTED, UNKNOWN.
If State = "CONNECTED" Then
If gmap.IsInitialized Then
Tracker.GPS.Start(gmap.MyLocation.Latitude,gmap.MyLocation.Longitude)
End If
internetConnectionStatus(False,"")
Starter.internet_connected=True
Try
'Starter.mqtt.Initialize("mqtt", Starter.serverURI, Rnd(0, 999999999) & DateTime.Now)
Dim mo As MqttConnectOptions
mo.Initialize("xxx", "xxx")
Starter.mqtt.Connect2(mo)
Log("mqtt_init")
Starter.mqttConnected=True
Catch
Log("MQTT / " & LastException)
End Try
Else
internetConnectionStatus(True,"No Internet. Connect Wi-Fi or Mobile Network")
Tracker.GPS.Stop
Starter.internet_connected=False
Starter.mqttConnected=False
End If
End Sub
Could you please advice as how to clear the GPS cache when the internet is not available.
Thanks