Telephonymanager Telmanager =(Telephonymanager) Getsystemservice (context.telephony_service);/**Get SIM card IMSI * SIM card Unique ID: IMSI International Mobile Subscriber Identification Number (imsi:international Mobile subscriber Identification number) is the logo that distinguishes the mobile user, * Stored in a SIM card that can be used to distinguish valid information from a mobile user. IMSI is composed of MCC, MNC, Msin, of which MCC is a mobile country number, consisting of 3 digits, * Uniquely identify the country that the mobile customer belongs to, our country is the network ID of the 460;MNC, and it is composed of 2 digits, * To identify mobile network belonging to mobile clients, China Mobile is 00, China Unicom is 01, the Chinese telecom for 03;msin Mobile Customer Identification Code, the use of equal length 11 digits. * Uniquely identify domestic GSM mobile communication network to move customers. So to distinguish between mobile or unicom, just get the MNC field in the SIM card*/String IMSI=Telmanager.getsubscriberid ();if(imsi!=NULL){ if(Imsi.startswith ("46000") | | imsi.startswith ("46002")) {//because the mobile network number 46000 under the IMSI has run out, so virtual a 46002 number, 134/159th segment Use this number//China Mobile}Else if(Imsi.startswith ("46001")){ //China Unicom}Else if(Imsi.startswith ("46003")){ //China Telecom }}
IMSI: International Mobile Subscriber Identification number (unique identifier), IMSI = MCC + MNC + msin, where MCC refers to the mobile station country code (3-bit, China 460), MNC refers to the mobile network Code (2 Chinese), Msin refers to mobile user identification numbers (10-bit)
IMSI a total of 15 bits, the structure is as follows:
Mcc+mnc+msin, (Mnc+msin=nmsi)
Mcc:mobile Country Code, mobile Country Code, MCC resources by the ITU (ITU) unified distribution and management, the only identification of mobile users belong to the country, a total of 3, China is 460;
Mnc:mobile Network Code, mobile code, a total of 2, China Mobile TD system use 00, the Chinese Unicom GSM system use 01, Mobile GSM system use 02, China Telecom CDMA system using 03, A typical IMSI number is 460030912121001;
The Msin:mobile Subscriber identification number has 10 bits, which are structured as follows:
09+m0m1m2m3+abcd
There is a correspondence between the M0M1M2M3 and the h0h1h2h3 in the MDN number, and the ABCD four bits are allocated freely.
You can see IMSI in the Msin number before the MCC is Nmsi, can distinguish each user from the country, so can achieve international roaming. In the same country, if there are multiple mobile network operators, the MNC can be used to differentiate.
Reprinted from: http://blog.csdn.net/dream19861009/article/details/6072935
[Android Pro] through IMSI to determine the mobile phone is mobile, unicom, telecommunications