I am trying to find how to get a MCC/MNC id code (also called PLMN code) for a given cellphone number in Android. I am trying to determine which carrier the number is on before making a call.
Asked
Active
Viewed 3,677 times
-3
-
And your question is? What have you tried? – Emil Vikström Oct 22 '12 at 18:34
-
I can answer your question.... but do tell us what have you tried ? And yes you can determine the MCC/MNC/LAC/CID – drulabs Oct 22 '12 at 19:35
-
i am also trying to do this. Have you got solution to do this? or is it even possible? – Uzair Qaiser Jul 04 '18 at 07:13
1 Answers
1
You can only retrieve the MCC/MNC for your own phone, not for that of any given cellular number:
TelephonyManager tel = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE);
String networkOperator = tel.getNetworkOperator();
if (networkOperator != null) {
int mcc = Integer.parseInt(networkOperator.substring(0, 3));
int mnc = Integer.parseInt(networkOperator.substring(3));
}
Phone calls are targeted at a PHONE number, regardless of the MCC/MNC of the receiving device. Unless you can obtain access to a third-party database to resolve a phone number to an operator, you're out of luck here. I'm unaware of any such database.

323go
- 14,143
- 6
- 33
- 41