Android gets SIM card information -- TelephonyManager

Source: Internet
Author: User

 

1> Get TelephonyManager
TelephonyManager telMgr = (TelephonyManager) getSystemService (TELEPHONY_SERVICE );

2> Get SIM card status
TelMgr. getSimState ();

3> Get SIM card number

TelMgr. getSimSerialNumber ();

4> Get SIM card supplier number

TelMgr. getSimOperator ();

5> Get SIM card Supplier name

TelMgr. getSimOperatorName ();

6> obtain the country of the SIM card

TelMgr. getSimCountryIso ();

7> retrieve mobile phone type

TelMgr. getPhoneType ();

8> obtain the network type

TelMgr. getNetworkType ();

9> get the network supplier number

TelMgr. getNetworkOperator ();

10> get the network vendor name

TelMgr. getNetworkOperatorName ();

11> Get mobile phone number

TelMgr. getLine1Number ();

 

 

 

// Roaming status
TelMgr. isNetworkRoaming ();
// IMEI
TelMgr. getDeviceSoftwareVersion ();
// IMSI
TelMgr. getSubscriberId ();

ContentResolver cv = sampleactivitysubmit this. getContentResolver ();
String tmpS = "";
// Whether or not Bluetooth is enabled
TmpS = android. provider. Settings. System. getString (cv, android. provider. Settings. System. effecth_on );
// Whether WIFI is enabled
TmpS = android. provider. Settings. System. getString (cv, android. provider. Settings. System. WIFI_ON );
// Whether the flight mode is enabled
TmpS = android. provider. Settings. System. getString (cv, android. provider. Settings. System. AIRPLANE_MODE_ON );
// Whether data roaming is enabled
TmpS = android. provider. Settings. System. getString (cv, android. provider. Settings. System. DATA_ROAMING );

 

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.