The only way I\'ve found of retrieving MCC and MNC is by overriding an activity\'s onConfigurationChanged method, as such:
public void onConfigurationChanged
You do know there are two MCC/MNC's for an active phone? (One is the country code and carrier id for the Sim card, the other is for the network/cell tower in use.)
If the getResources().getConfiguration().mcc
is not empty in airplane mode, it's the Sim
value TelephonyManager.getSimOperator()
, not the tower
value TelephonyManager.getNetworkOperator()
.
I don't know which the OP wants, but Answer 3 will give him different results than his original code if the getConfiguration
is really the Sim
values.