In google maps I can get the latitude and longitude of the point on which ever I touch. Now how can I get the address of the Latitude and Longitude(reverse geocoding).
Asked
Active
Viewed 228 times
-2
-
1http://stackoverflow.com/a/9409229/1339473 see this one.. – QuokMoon Mar 11 '13 at 06:24
-
check out this answer : http://stackoverflow.com/a/9409229/1567588 – SKK Mar 11 '13 at 06:28
1 Answers
0
List<Address> addresses = null;
try {
Locale mLocale = new Locale("en");
Geocoder gCoder = new Geocoder(context , mLocale);
addresses = gCoder.getFromLocation(lat, lng, 1);
Address addr = addresses.get(0);
...
...
..
} catch (Exception e) {
}

Archie.bpgc
- 23,812
- 38
- 150
- 226
-
-
-
1if ever exception occurs, you need weeks to find it out :) I guess `catch (Exception e)` is the worst thing in programming you can do. – Mohsin Naeem Mar 11 '13 at 06:31
-
The above code usually gives a `Service not available` Exception message, using which we can show appropriate message. And it explicitly asks to catch the `IOException` while calling `getFromLocation` – Archie.bpgc Mar 11 '13 at 06:36