It's not very proffessional, but for the beginning, it works fine for me:
Here is also a link for geocoding:
Greetings...
B4X:
Sub Process_Globals
Dim HTTPReverseGeocoding As HttpClient
End Sub
Private Sub Application_Start (Nav As NavigationController)
NavControl = Nav
Page1.Initialize("Page1")
Page1.Title = "Page 1"
Page1.RootPanel.Color = Colors.White
NavControl.ShowPage(Page1)
HTTPReverseGeocoding.Initialize("HTTPReverseGeocoding")
Reverse_Geocoding
End Sub
Sub Reverse_Geocoding
Dim URL As String
URL = "http://maps.google.com/maps/api/geocode/json?latlng=51.767454,5.868676&sensor=False"
Dim request As HttpRequest
request.InitializeGet(URL)
request.Timeout = 10000 'set timeout to 10 seconds
HTTPReverseGeocoding.Execute(request, 1)
End Sub
Sub HTTPReverseGeocoding_ResponseError (Reason As String, StatusCode As Int, TaskId As Int)
log("Fehler beim Laden der Adresse!")
End Sub
Sub HTTPreverseGeocoding_ResponseSuccess (Response As HttpResponse, TaskId As Int)
Dim Adresse As List
Adresse.Initialize
Dim parser As JSONParser
parser.Initialize(Response.GetString)
Dim root As Map = parser.NextObject
Dim results As List = root.Get("results")
For Each colresults As Map In results
Dim formatted_address As String = colresults.Get("formatted_address")
Adresse.Add(formatted_address)
Next
Log(Adresse.Get(0))
End Sub
Here is also a link for geocoding:
B4X:
"http://maps.google.com/maps/api/geocode/xml?address=Weifert-Janz-Straße+1+Mainz&sensor=False"
Greetings...