3

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.

hippietrail
  • 15,848
  • 18
  • 99
  • 158
svenkapudija
  • 5,128
  • 14
  • 68
  • 96

1 Answers1

8
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).

Anthony Graglia
  • 5,355
  • 5
  • 46
  • 75
lucian.pantelimon
  • 3,673
  • 4
  • 29
  • 46
  • 1
    If it must be from the SIM card (which presumes the phone and network use a SIM card), might `TelephonyManager.getSimCountryIso()` be better? Also, if only resources need to be customized, there's a resource directory qualifier for the MCC. – erichamion Mar 15 '11 at 01:05
  • Again, it depends what you are looking for. If you want to get the originating country or it's real position. SIM Country ISO will get you the originating country, but what will you get from it when the user is abroad using Roaming? You won't get it's current position this way, just the country where he bought the SIM. But if this is what you're interested in, then I think it'll work. :) – lucian.pantelimon Mar 15 '11 at 07:54