Question

Is there a way to check what is the user's country? "Locale" isn't good enough because there are plenty of English locales but they are spread all over the world.

Maybe somehow with IMEI or...?

So actually I need to find out which country does the SIM card belong to?

EDIT: GPS or internet are not allowed.

Was it helpful?

Solution

android.telephony.TelephonyManager.getNetworkCountryIso()

More info Android documentation - TelephonyManager.

Edit: Depends what you are looking for. IMEI may not be relevant as the phone might have been ordered/bought from another country or the user might be in another country when using it. Also I don't know if the IMEI tells you the actual contry the device is being sold in, but rather the country of the manufacturer (not sure on this one though).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top