当前位置:操作系统 > 安卓/Android >>

Android获取SIM卡信息--TelephonyManager

 

1>获得TelephonyManager
TelephonyManager telMgr = (TelephonyManager) getSystemService(TELEPHONY_SERVICE);

2>获取SIM卡状态
telMgr.getSimState();

3>获取SIM卡卡号

telMgr.getSimSerialNumber();

4>获取SIM卡供货商号

telMgr.getSimOperator();

5>获取SIM卡供货商名称

telMgr.getSimOperatorName();

6>获取SIM卡国别

telMgr.getSimCountryIso();

7>获取手机类型

telMgr.getPhoneType();

8>获取网络类型

telMgr.getNetworkType();

9>获取网络供应商号

telMgr.getNetworkOperator();

10>获取网络供应商名称

telMgr.getNetworkOperatorName();

11>获得手机号码

telMgr.getLine1Number();

 

 

 

//漫游状态
telMgr.isNetworkRoaming();
//IMEI
telMgr.getDeviceSoftwareVersion();
//IMSI
telMgr.getSubscriberId();

ContentResolver cv = SampleActivity20.this.getContentResolver();
String tmpS = "";
//蓝牙是否开启
tmpS = android.provider.Settings.System.getString(cv,android.provider.Settings.System.BLUETOOTH_ON);
//WIFI是否开启
tmpS = android.provider.Settings.System.getString(cv,android.provider.Settings.System.WIFI_ON);
//飞行模式是否开启
tmpS = android.provider.Settings.System.getString(cv,android.provider.Settings.System.AIRPLANE_MODE_ON);
//数据漫游是否开启
tmpS = android.provider.Settings.System.getString(cv,android.provider.Settings.System.DATA_ROAMING);

 

补充:移动开发 , Android ,
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,