Public Sub Track
If Tracking Then Return
If Main.rp.Check(Main.rp.PERMISSION_ACCESS_FINE_LOCATION) = False Then
Log("No permission")
Return
End If
GPS.Start(0, 0)
Tracking = True
End Sub
Sub GPS_LocationChanged (Location1 As Location)
Dim strLoc As String
If DateTime.Now > LastUpdateTime + 10 * DateTime.TicksPerSecond Then
Dim n As Notification = CreateNotification($"$2.5{Location1.Latitude} / $2.5{Location1.Longitude}"$)
n.Notify(nid)
LastUpdateTime = DateTime.Now
gpslat = Location1.Latitude
gpslong = Location1.Longitude
If gpslat>0 And gpslong>0 Then
'CallSubDelayed2(Main,"Update_Location",Location1)
Dim bc As ByteConverter
strLoc=gpslat & "/" &gpslong '& qrActivity.sessionId ''''"newloc_" &
If Starter.mqtt.Connected Then
Starter.mqtt.Publish("driver_" & qrActivity.sessionId,bc.StringToBytes(strLoc ,"UTF8"))
Else
Log("MQTT not connected")
End If
ToastMessageShow(gpslat & "/" &gpslong,True)
End If
End If
End Sub