Android Question GPS Get help

Ksmith1192

Member
Licensed User
Longtime User
Hi guys, I am trying to get my GPS to get the location's lat and long as soon as the app starts. Is there an easier way to do it besides what I am doing?

Dim Lat as String
Dim Longt as string

B4X:
Sub Activity_Create(FirstTime As Boolean)
 GPS1.Initialize("GPS")
GPS1.Start(0,0)

end sub

Sub GPS_LocationChanged (Location1 As Location)
    LAT = Location1.ConvertToMinutes(Location1.Latitude)   
    LONGT = Location1.ConvertToMinutes(Location1.longitude)

end sub

I want to put these GPS values into their corresponding strings. When I test, it does not work. Any suggestions?
 

Ksmith1192

Member
Licensed User
Longtime User
I am testing it on a working android device, and I can't get the coordinates. I try to convert it to a string, and display it on a label but the results never show.
 
Upvote 0
Top