views:

491

answers:

2

My Android application needs to react differently to different Mobile Country Codes.

It seems like it is hardcoded to mcc310 (US). I can read this value from TelephonyManager.getSimCountryIso() or by using a resource folder like res/values-mcc123/, but how do I set this value in the emulator?

A: 

On emulator: go to Settings->WireLess and Network->Mobile Network->Access Point Names. Try changing MCC value in the set APN and then try your code.

Samuh
Good idea, but it didn't work. When I tried this the APN disappeared from the list, and my application couldn't access the network anymore.
neu242
Well,in my case the APN did disappear and I got: "No Network connection" when I fired up the browser. But when I okayed the alert, I was able to surf the internet. Strange behavior. Anyways, you can do a "Reset to Default" on the APN page and get your earlier APN back.
Samuh
A: 

Do know that relying on an MCC is not always correct in every country. Digicell for instance use one MCC+MNC in several countries. Also understand that the whole idea of an MCC is rather ludicrous from an network point of view. It is rather irrelevant to know if you're in Germany or in the Netherlands if both times you're on T-Mobile with an AT&T handset.

Raindeer