How to get 3 digit country code from latitude and longitude in android
Can anyone please tell me how to get 3 digit country code (like India-IND) from longitude longitude
here is my code for getting 2 digit country code
latitude = gps.getLatitude();
longitude = gps.getLongitude();
geocoder = new Geocoder(getActivity(), Locale.getDefault());
addresses = geocoder.getFromLocation(latitude, longitude, 1);
Country = addresses.get(0).getCountryName();
String Country_code1=addresses.get(0).getCountryCode();
+3
M.Neelima
source
to share
1 answer
There is a simple way to do this:
address.getLocale().getISO3Country();
More about Locale and ISO3 codes and a little more about country codes .
+1
AlphaQ
source
to share