Hi all,
I have been looking at the GPS functions, added the library and looked at the demo on http://www.b4x.com/forum/basic4android-getting-started-tutorials/6592-gps-tutorial.html#post38535 , that is ok, my question is how can I invoke the gps to provide location details upon a button click event?
so similar to:
Sub GPS_LocationChanged (Location1 As Location)
lblLat.Text = "Lat = " & Location1.ConvertToMinutes(Location1.Latitude)
lblLon.Text = "Lon = " & Location1.ConvertToMinutes(Location1.Longitude)
lblSpeed.Text = "Speed = " & Location1.Speed
End Sub
how can I do this for a button click event, I'd like to be able to get current longitude/latitude values whenever I need to..
when the gps starts. e.g.:
Sub Activity_Create(FirstTime As Boolean)
If FirstTime Then
GPS1.Initialize("GPS")
End If
Activity.LoadLayout("1")
End Sub
so when initilizing , then the longitude/latitude values are 0, so I would need to move to get some values/data before I can query these in my button click event?
Any help / advise would be most kind.
Kim
I have been looking at the GPS functions, added the library and looked at the demo on http://www.b4x.com/forum/basic4android-getting-started-tutorials/6592-gps-tutorial.html#post38535 , that is ok, my question is how can I invoke the gps to provide location details upon a button click event?
so similar to:
Sub GPS_LocationChanged (Location1 As Location)
lblLat.Text = "Lat = " & Location1.ConvertToMinutes(Location1.Latitude)
lblLon.Text = "Lon = " & Location1.ConvertToMinutes(Location1.Longitude)
lblSpeed.Text = "Speed = " & Location1.Speed
End Sub
how can I do this for a button click event, I'd like to be able to get current longitude/latitude values whenever I need to..
when the gps starts. e.g.:
Sub Activity_Create(FirstTime As Boolean)
If FirstTime Then
GPS1.Initialize("GPS")
End If
Activity.LoadLayout("1")
End Sub
so when initilizing , then the longitude/latitude values are 0, so I would need to move to get some values/data before I can query these in my button click event?
Any help / advise would be most kind.
Kim