1

I've just delved into the world of Global Positioning System (GPS) and found the following interesting facts:

1) The Android class android.location.Geocoder always returns null when getting address via reverse geocoding. The code I used is:

Geocoder mGeocoder = new Geocoder(context, locale);
List<Address> addresses = mGeocoder.getFromLocation(latitude, longitude, 1);
if (!addresses.isEmpty()) {
    // do something.
} else {
    // Display a message regarding no address available.
}

The reason is stated here:

The Geocoder class requires a backend service that is not included in the core android framework.

So, essentially I would either have to provide offline geolocation data myself for reverse geocoding, or my Android app will have to connect to the Internet and look up geolocation data from Google (via http://maps.googleapis.com/maps/api/geocode/json?latlng= for example). Or use alternative geolocation providers like OpenStreetMap, etc.

2) Android apps like Google Maps requires an Internet connection; while offline provider like TomTom bundled offline geolocation data together with their app so an Internet connection is not needed.

Beside the stated facts above, is there another alternative for retrieving geolocation address without using offline reverse geographic data or using an Internet connection?

If you have some experience with geocoding and reverse geocoding in Android, then please post your thoughts.

Thanks.

Yash Sampat
  • 30,051
  • 12
  • 94
  • 120
  • Apart from the methods you've stated in your post, I don't know of any other method for reverse geocoding. –  Jun 11 '15 at 09:09
  • For OSM based geocoding you can try the Telenav SDK as they come with offline geocoding and reverse geocoding: http://developer.skobbler.com/getting-started/android#sec019 – Ando Jun 12 '15 at 10:05

2 Answers2

0

There is at least one way for each.

For reverse-geocoding, you let the user mark the geolocation of the address himself using gps.

For geocoding, you let the user hunt down a set of coordinates and then you have him read the street name and the address he finds himself at.

Stephan Branczyk
  • 9,363
  • 2
  • 33
  • 49
  • Thanks for posting your answer, but my requirement is different to what you have suggested. ;) –  Jun 11 '15 at 09:50
0

There are few offline libraries available to reverse Geocode offilne. Suggest you to go through these libraries.Personally i have not used these libraries.Let me know if you still face any problems.

https://developers.arcgis.com/android/

Sample code for link:

https://github.com/Esri/arcgis-runtime-samples-android/tree/master

Meher
  • 2,545
  • 3
  • 26
  • 53