`
GhostFromheaven
  • 浏览: 394158 次
  • 性别: Icon_minigender_1
  • 来自: 武汉
社区版块
存档分类
最新评论

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);

 

 

int getCallState()
Returns a constant indicating the call state (cellular) on the device.
CellLocation getCellLocation()
Returns the current location of the device.
int getDataActivity()
Returns a constant indicating the type of activity on a data connection (cellular).
int getDataState()
Returns a constant indicating the current data connection state (cellular).
String getDeviceId()
Returns the unique device ID, for example, the IMEI for GSM and the MEID or ESN for CDMA phones.
String getDeviceSoftwareVersion()
Returns the software version number for the device, for example, the IMEI/SV for GSM phones.
String getLine1Number()
Returns the phone number string for line 1, for example, the MSISDN for a GSM phone.
List<NeighboringCellInfo> getNeighboringCellInfo()
Returns the neighboring cell information of the device.
String getNetworkCountryIso()
Returns the ISO country code equivalent of the current registered operator's MCC (Mobile Country Code).
String getNetworkOperator()
Returns the numeric name (MCC+MNC) of current registered operator.
String getNetworkOperatorName()
Returns the alphabetic name of current registered operator.
int getNetworkType()
Returns a constant indicating the radio technology (network type) currently in use on the device for data transmission.
int getPhoneType()
Returns a constant indicating the device phone type.
String getSimCountryIso()
Returns the ISO country code equivalent for the SIM provider's country code.
String getSimOperator()
Returns the MCC+MNC (mobile country code + mobile network code) of the provider of the SIM.
String getSimOperatorName()
Returns the Service Provider Name (SPN).
String getSimSerialNumber()
Returns the serial number of the SIM, if applicable.
int getSimState()
Returns a constant indicating the state of the device SIM card.
String getSubscriberId()
Returns the unique subscriber ID, for example, the IMSI for a GSM phone.
String getVoiceMailAlphaTag()
Retrieves the alphabetic identifier associated with the voice mail number.
String getVoiceMailNumber()
Returns the voice mail number.
boolean hasIccCard()
boolean isNetworkRoaming()
Returns true if the device is considered roaming on the current network, for GSM purposes.
void listen(PhoneStateListener listener, int events)
Registers a listener object to receive notification of changes in specified telephony states.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

分享到:
评论
1 楼 zzh370971456 2011-09-24  
好像忘了加权限吧。

相关推荐

    Android-获取SIM卡信息Android:基于TelephonyManageriOS基于CoreTelephony

    获取SIM卡信息: Android:基于TelephonyManager iOS:基于CoreTelephony

    Android获取手机SIM卡运营商信息的方法

    本文实例讲述了Android获取手机SIM卡运营商信息的方法,对于Android程序设计有非常实用的价值。分享给大家供大家参考之用。具体方法如下: 主要功能代码如下: /** * 获取SIM卡运营商 * * @param context * @...

    Android 判断SIM卡是中国移动\中国联通\中国电信(移动运营商)

    /** 获取SIM卡的IMSI码 * SIM卡唯一标识:IMSI 国际移动用户识别码(IMSI:International Mobile Subscriber Identification Number)是区别移动用户的标志, * 储存在SIM卡中,可用于区别移动用户的有效信息。IMSI...

    Android手机管理器源码,检测检测手机运营商及SIM卡信息

    摘要:Java源码,Android源码,手机管理器,SIM卡 TelephonyManager android 手机程序源代码,检测手机运营商及SIM卡信息,是Android系统的手机管理器,可检测出您手机的设备号、软件版本、网络运营商代号及名称、手机...

    浅析Android手机卫士sim卡绑定

    读取sim卡的序列号,保存起来,一旦sim发生变更了,认为是小偷的sim卡,发出警告 读取sim卡序列号 获取TelephonyManager对象,通过getSystemService(TELEPHONY_SERVICE) 调用TelephonyManager对象的...

    Android获取本机电话号码的简单方法

    如何在Android上获取本机电话号码,目前Android上提供了一个API可以读取早期SIM卡上固化的号码, 代码如下:private String getPhoneNumber(){ TelephonyManager mTelephonyMgr; mTelephonyMgr = (TelephonyManager...

    Android开发应用实战详解源代码

    5.15 获取sim卡内信息 5.15.1 sim卡简介 5.15.2 实现原理 5.15.3 具体实现 5.16 触屏拨号 5.17 获取正在运行的程序 5.18 变换屏幕的方向 5.19 获取设备信息 5.20 小结 第6章 手机自动服务 6.1 实现短信提醒 6.2 剩余...

    Android中TelephonyManager类的方法实例分析

    本文实例讲述了Android中TelephonyManager类的方法。分享给大家供大家参考。具体如下: TelephonyManager类主要提供了一系列用于访问与手机通讯相关的状态和信息的get方法。其中包括手机SIM的状态和信息、电信网络的...

    天天手机助手

    获取手机SIM卡联系人,支持添加、修改、删除联系人,快速查找联系人,通讯等操作 2、电池管理 可以显示电池当前的电量,温度,电压,电池充电时进行实时保护; 3、照相机 可以调焦进行拍照,开启和关闭闪关灯,...

    React Native 模块桥接获取用户的家庭蜂窝服务提供商的信息,

    React Native Carrier Info React Native 模块桥接以获取有关用户的家庭蜂窝服务提供商的信息。 使用以下本机类: iOS CTTelephonyNetworkInfo CTCarrier Android TelephonyManager 版本 1.0.0 Android 支持 ...

    Android高版本API方法如何在低版本系统上做兼容性处理浅析

    在最近的开发中需要获取到SIM卡的网络状态,在源码中看到一个方法: TelephonyManager tm =(TelephonyManager)context.getSystemService(TELEPHONY_SERVICE); state =tm.getDataNetworkType(); 但是报错了Call ...

Global site tag (gtag.js) - Google Analytics