I usually get the country from the device\'s language. It works but now I have to recognize Brazil. And most of the devices only have portuguese (pt_PT), and no portuguese (
TelephonyManager mTelephonyManager = (TelephonyManager) getSystemService(TELEPHONY_SERVICE);
mTelephonyManager.getNetworkCountryIso();
As answered by Eric, the above code is the best approach. It is also worth noting that,
mTelephonyManager.getSimCountryIso()
should not be used as this would indicate the home country of the SIM provider (E.g. A Vodaphone UK SIM would return "gb", A Vodaphone Germany SIM would return "de") and not the current location (Country) of the device. This difference is significant when the user is roaming.