Sub GPS_LocationChanged (Location1 As Location)
If DateTime.Now > LastUpdateTime + 10 * DateTime.TicksPerMinute Then
Dim n As Notification = CreateNotification($"$2.5{Location1.Latitude} / $2.5{Location1.Longitude}"$)
n.Notify(nid)
LastUpdateTime = DateTime.Now
SendLocationData(Location1.Longitude,Location1.Latitude)
End If
End Sub
Sub SendLocationData(Lon As Double,Lat As Double)
Dim userid As String
ToastMessageShow("Sending location data to server...",True)
userid="21"
Dim job As HttpJob
job.Initialize("",Me)
job.PostString("http://apiservice.com/location_mapper.php","user_id=" & userid & "&longitude=" & Lon & "&latitude=" & Lat)
Wait For (job) JobDone(job As HttpJob)
If job.Success Then
Log(job.GetString)
Else
ToastMessageShow(job.ErrorMessage,True)
End If
job.Release
End Sub