Some of Android's most popular mobile phone information gets

Source: Internet
Author: User

The classes related to telephony in Android are Telephonymanager, and many constants are defined in this class, and the following categories describe
Get the following information to specify permissions in Androidmanifest.xml

First, the data connection status
Get Data Connection Status: Int getdatastate ()
Get Data Activity status: Int getdataactivity ()
There are several common ones:
int data_activity_in Data Connection Status: active, receiving data
int data_activity_out Data Connection Status: active, sending data
int data_activity_inout Data Connection Status: Active, receiving and sending data
int Data_activity_none Data Connection status: active, but no data sent and accepted
int data_connected data Connection status: connected
int data_connecting data connection status: Connecting
int data_disconnected data connection status: Disconnect
int data_suspended data Connection status: Paused

Ii. Types of mobile networks
Get network type: int Getnetworktype ()
There are several common ones:
int NETWORK_TYPE_CDMA network type is CDMA
int Network_type_edge network type is EDGE
int NETWORK_TYPE_EVDO_0 network type is EVDO0
int network_type_evdo_a network type is EVDOA
int NETWORK_TYPE_GPRS network type is GPRS
int NETWORK_TYPE_HSDPA network type is HSDPA
int NETWORK_TYPE_HSPA network type is HSPA
int Network_type_hsupa network type is HSUPA
int NETWORK_TYPE_UMTS network type is UMTS
In China, Unicom's 3G is UMTS or HSDPA, mobile and Unicom 2G for GPRS or EGDE, telecom 2G for CDMA, telecom 3G for EVDO

Three, the type of mobile phone format
Get phone format: int getphonetype ()
int PHONE_TYPE_CDMA mobile phone format for CDMA, telecom
int PHONE_TYPE_GSM mobile phone format for GSM, Mobile and Unicom
int phone_type_none cell phone format unknown

Iv. Status of SIM card
Get SIM card status: Int Getsimstate ()
int sim_state_absent SIM Card not found
int sim_state_network_locked SIM Card Network is locked and needs to be unlocked
int sim_state_pin_required SIM PIN is locked and requires user pin to unlock
int sim_state_puk_required SIM card PUK is locked and requires user PUK to unlock
int Sim_state_ready SIM Card available
int Sim_state_unknown SIM Card Unknown

V. OTHER INFORMATION
String Getsimcountryiso ()
Return the country code of the SIM card provider
String Getnetworkcountryiso ()
Returns the ISO standard country code, which is the international calling code
String Getsimoperator ()
String Getnetworkoperator ()
Return MCC+MNC code (SIM card carrier country code and carrier Network Code) (IMSI)
String Getsimoperatorname ()
String Getnetworkoperatorname ()
Returns the name of the mobile network operator (SPN)
String Getsubscriberid ()
Return to IMSI, the International Mobile Subscriber ID
String Getdeviceid ()
If it is a GSM network, return the IMEI; if it is a CDMA network, return to Meid
String Getsimserialnumber ()
Returns the serial number (IMEI) of the SIM card
String Getline1number ()
Return mobile phone number, for GSM network is MSISDN
Boolean isnetworkroaming ()
Returns whether the phone is in a roaming state

Explain:
IMSI is the abbreviation for the International Mobile Subscriber Identification Code (International Mobile Subscriber Identity)
IMSI a total of 15 bits, the structure is as follows:
Mcc+mnc+min
Mcc:mobile Country Code, mobile country Code, a total of 3 people, China is 460;
Mnc:mobile Networkcode, mobile network code, total 2 bits
In China, the code for Mobile is 00 and 02, the code for Unicom is 01, and the code for telecommunications is 03.
The combination is (also the code in the APN configuration file on the Android phone):
China Mobile: 46000 46002
China Unicom: 46001
China Telecom: 46003
For example, a typical IMSI number is 460030912121001.

IMEI is the abbreviation for International Mobile Equipment identity (International mobile device identity)
The IMEI consists of a 15-digit "E-string", which corresponds to one by one of each phone, and the code is the only one in the world
Its composition is:
1. The first 6 digits (TAC) is the "Model approval number", the general representative of the model
2. The next 2 digits (FAC) is the "final assembly number", which generally represents the origin
3. The subsequent 6-digit (SNR) is the "serial number", which generally represents the production sequence number
4. The last 1 digits (SP) are usually "0″, for the test code, the current standby

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.