Get country from coordinates?

ArtKorchagin picture ArtKorchagin · Jun 18, 2012 · Viewed 19.3k times · Source

How to get country name in Android, If are known geo coordinates? How to make it the simplest way?

Answer

Vipul picture Vipul · Jun 18, 2012

Here you go

Geocoder gcd = new Geocoder(context, Locale.getDefault());
List<Address> addresses = gcd.getFromLocation(lat, lng, 1);

    if (addresses.size() > 0)
     {  
       String countryName=addresses.get(0).getCountryName();
     }