Reverse Geo-coding

by Monday, March 19, 2012 0 comments
To convert latitude & longitude of location to Address using the method called Reverse Geo-coding.

using getFromLocation(latitude lat, longitude lng, intmaxlength x);
Below coding is used for getting address.

    Geocoder geoCoder = new Geocoder(
        getBaseContext(), Locale.getDefault());
    try {
      List
addresses = geoCoder.getFromLocation(lat,lng,1);

      if (addresses.size() > 0 && addresses != null) {
          StringBuilder result = new StringBuilder();
          myLoc.setText("Now i'm in " +addresses.get(0).getFeatureName()+"-"+addresses.get(0).getLocality()+"-"+addresses.get(0).getAdminArea()+"-"+addresses.get(0).getCountryName() + " at " + dt);

     }
     }
    catch (IOException e) {       
      e.printStackTrace();
    }
 

karthik nagarajan

Androider

Welcome to Android-Action Blog. I’m a normal guy, who is passionate about Mobile Coding. Here I am writing about Android. Happy learning

0 comments:

Post a Comment