Mobile, Unicom, and telecom SIM in Android applications

Source: Internet
Author: User

International Mobile User identification code (imsi) International Mobile Subscriber Identity

The number assigned by a mobile user is uniquely identified internationally.

Technically speaking, imsi can completely solve the problem of international roaming. However, because a large number of AMPS Systems in North America still use min numbers, and MDN and min in North America use the same number, the system cannot be changed. Currently, international roaming is dominated by Min. Among them, the min resource with the O and 1 headers is referred to
Roaming min), centrally managed by ifast (International Forum on ANSI-41 standards technology. Currently, China Unicom's request for the resource is directed at 09. As we can see, with the increase of users, the min resources used for international roaming will soon run out, and it is imperative to globally use imsi to identify users.

Edit the structure combination of this section

Imsi has a total of 15 digits, and its structure is as follows:

MCC + MNC + msin

MCC: Mobile country code, mobile country code, and MCC resources are centrally allocated and managed by ITU (ITU). The only country that identifies a mobile user is located in three places, with 460 in China;

MNC: mobile network code, mobile network code, two digits in total, China Mobile System 00, 02, 07, China Unicom GSM system 01, China Telecom CDMA system 03, the typical imsi number is 460030912121001;

Msin: mobile subscriber identification number, which is a 10-digit mobile user identification number. Its structure is as follows:

EF + m0m1m2m3 + ABCD

Among them, the m0m1m2m3 and the h0h1h2h3 in the mdn number can have a correspondence relationship, and the four bits of ABCD are freely allocated.

We can see that imsi has added MCC before the nmsi number, which can differentiate the countries where each user is from, so it can implement international roaming. In the same country, if there are multiple mobile network operators, you can use MNC to differentiate them.

======================================

Different from IMEI: International Mobile Equipment Identity (international mobile device identification)

International Mobile User identification code and open-source projects

Openbts is software-based
The GSM access port provides a standard GSM-compatible mobile phone. You do not need to use an interface from a ready-made phone provider to call the interface of an existing phone system. Openbts is the first GSM protocol stack based on industrial standards of open source software. Openbts
It uses the International Mobile User identification code (imsi) International Mobile Subscriber Identity. Openbts and openbsc provide open-source platforms to learn more about GSM network technologies at a lower level.




TM = (telephonymanager) This. getsystemservice (telephony_service );
/*
* Returns the ISO country code equivalent for the sim provider's country code.
* Obtain the ISO country code, which is equivalent to the Country Code that provides the SIM card.
*
*/
String simiso = TM. getsimcountryiso (); // string
/*
* Returns the MCC + MNC (mobile country code + mobile network code) of the provider of the sim. 5 or 6 decimal digits.
* Obtain the mobile country code and mobile network code. 5 or 6-digit decimal number provided by the SIM card.
* The SIM card status must be sim_state_ready (determined by getsimstate ).
*/
String simoper = TM. getsimoperator (); // string
/*
* Service provider name:
* For example, China Mobile and China Unicom
* The SIM card status must be sim_state_ready (determined by getsimstate ).
*/
String simopername = TM. getsimoperatorname (); // string
/*
* Sim card serial number:
* Permission required: read_phone_state
*/
String simserial = TM. getsimserialnumber (); // string
/*
* Sim status information:
* Sim_state_unknown unknown status 0
Sim_state_absent no card 1
Sim_state_pin_required lock status, which requires the user's pin code to be unlocked 2
Sim_state_puk_required lock status, which requires the user's pukcode to be unlocked 3
Sim_state_network_locked lock status, which requires the network pin to be unlocked 4
Sim_state_ready ready status 5
*/
Int simstate = TM. getsimstate (); // int




You can use getprop to view the usage of the SIM card after entering the terminal ADB (dual-card can also be used)

System permission is required to obtain field information through systemproperties

For example, if you have the permission, you can directly obtain the field information.

String providername = systemproperties. Get (telephonyproperties. property_icc_operator_alpha );

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.