Android Question Require Latitude & Longitude only

SCS

Member
Licensed User
Longtime User
I just want to capture current Latitude & Longitude only. No Google Maps require.

I tested on GPS Tutorial (http://www.b4x.com/android/forum/threads/gps-tutorial.6592/) & Location Manager (http://www.b4x.com/android/forum/threads/locationmanager-library.13337/#content) too. seems like very slow on getting the LatLng.

Do you thing using the Google Maps (http://www.b4x.com/android/forum/threads/google-maps-android-v2-tutorial.24415/) is the best but ignore the show maps portions?

Or I miss out any useful libraries for just given fast LatLng?
 
there is no fast lan/lon-function... When enabling GPS it needs some time to get enough satelites-positions to figure out the lat/lon... If GPS stays on then it would be faster cause the satelistlist is already available
 
Upvote 0
Hello,
I basically use the following code in my weather widget.

In referenced libraries check Location manager
Code: Copy
Sub Globals
        Dim StoredLatitude, StoredLongitude As Double
        Dim CurrentLocation As LocationManager
End Sub

Code: Copy
Sub Activity_Create(FirstTime As Boolean)
        CurrentLocation.Initialize("CurrentLocation")
        CurrentLocation.requestMobileLocation
End Sub

'Current location
Code: Copy
Sub CurrentLocation_LocationChanged(Longitude As Double, Latitude As Double, Altitude As Double, Accuracy As Float, Bearing As Float, Provider As String, Speed As Float, Time As Long)
    StoredLatitude = Latitude
    StoredLongitude = Longitude

    CurrentLocation.stopMobileListening
End Sub


Good luck, I hope that this code helps :-)
 
Upvote 0
Back
Top