I am creating an application that depends on which country your mobile network provider is in, and displays a list of all alternative mobile network providers from the same country. To do this, I retrieved the country code using telephonyManager.getSimCountryIso () .
The official documents of Android developers report: "Returns the equivalent of the ISO country code for the SIM provider country code", so from this I expected that the country code will always be always regardless of the location of the device. But this is not how it actually works!
For example , I recently experienced this case: I have an Android device with a SIM card from Spain, owned by a Spanish network provider. So if I'm in Spain, telephonyManager.getSimCountryIso () returns "es". Everything worked well at that time. Problem: when I travel to France, for example, I debug the application and find out that telephonyManager.getSimCountryIso () returns the country code: "nl" (from the Netherlands !? and I'm roaming in France but with the same Spanish SIM card!). I use the same device and the same SIM card as in Spain, so the ISO country code should still be "es".
My question is How does this method really work? Why do I get the country code "nl" (Netherlands) if I use a Spanish SIM card?
Thank you in advance for your help.
source
share