문제

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.

도움이 되었습니까?

해결책

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top