Android Question How to get Real World address from FusedLocationProvider?

Cableguy

Expert
Licensed User
Longtime User
Hi guys,

I implemented successfully the FLP into an app I'm developing, but showing to the target users the gps data will be of little to no use to them.
How can I use the obtained location in to a "real world" location?

Thanks in advance
 

DonManfred

Expert
Licensed User
Longtime User
Upvote 0

klaus

Expert
Licensed User
Longtime User
Simple example:

B4X:
Sub Globals
    Private Geocoder1 As Geocoder
End Sub

Sub Activity_Create(FirstTime As Boolean)
    Geocoder1.Initialize("Geocoder1")
    Geocoder1.GetFromLocationName("Chemin de Clares 40 Fully", 1, "1")
    Geocoder1.GetFromLocation(46.1503641, 7.1431066, 1, "2")
End Sub

Private Sub Geocoder1_GeocodeDone(Results() As Address, Tag As Object)
    If Tag = "1" Then
        Log(Results(0).Latitude)
        Log(Results(0).Longitude)
    Else
        Log(Results(0).Thoroughfare)
        Log(Results(0).SubThoroughfare)
        Log(Results(0).PostalCode)
        Log(Results(0).Locality)
        Log(Results(0).AdminArea)
        Log(Results(0).CountryCode)
        Log(Results(0).CountryName)
        If Results(0).SubLocality <> Null Then
            Log(Results(0).SubLocality)           
        End If
    End If
End Sub
 
Upvote 0
Top