To get the country code stored on your phone’s SIM card, you can try
TelephonyManager telephonyManager = (TelephonyManager)context.getSystemService(Context.TELEPHONY_SERVICE);
telephonyManager.getSimCountryIso();
You can also try:
Locale locale = Locale.getDefault();
locale.getCountry();
This returns data in the language / country specified by the user, and not in the physical location.
source
share