Using the OSMDroid library from Warwound and in particular the MyLocationOverlay, the gps function is activated by enabling the function: MyLocationEnabled.
I need to start a timer [done that] which is started at the same time as the gps and counts up or down with a display on the screen. When the next fix has been found (ca. 15 minutes later), the timer should reset and start again.
I think I can manage this using the sub:
and inserting Timer1.stop at the start of the sub and Timer1.enabled at the end. Should work?
But how to count down?
How do I display the timer (is probably dead simple)?
Thanks for any help.
I need to start a timer [done that] which is started at the same time as the gps and counts up or down with a display on the screen. When the next fix has been found (ca. 15 minutes later), the timer should reset and start again.
I think I can manage this using the sub:
B4X:
Sub MyLocationOverlay1_LocationChanged(NewLocation As Location, IsFirstFix As Boolean)
'Log("MyLocationOverlay1_LocationChanged, Latitude="&NewLocation.Latitude&", Longitude="&NewLocation.Longitude&", IsFirstFix="&IsFirstFix)
SimpleLocationOverlay1.SetMyLocation2( NewLocation)
MapView1.SetCenter2(NewLocation)
SpeedKmh=NewLocation.Speed*3.6
acc=NumberFormat2(NewLocation.Accuracy,0,0,0,False)
Activity.Title="OSMDroid ["&MapView1.Zoom&"] - GPS Accuracy: "&acc&" m: Speed: "&SpeedKmh&" km/h"
End Sub
and inserting Timer1.stop at the start of the sub and Timer1.enabled at the end. Should work?
But how to count down?
How do I display the timer (is probably dead simple)?
Thanks for any help.