- 浏览: 394158 次
- 性别:
- 来自: 武汉
文章分类
最新评论
-
lulu15634219680:
Eclipse设置行宽Maximum line width -
gakes:
有没有正确的啊
Android手机号码判断正则表达式 -
GhostFromheaven:
mooshadow 写道你好,首先感谢你的程序。我最近也碰到了 ...
java合并两个XML文件 -
mooshadow:
你好,首先感谢你的程序。我最近也碰到了这个问题,用了你的程序之 ...
java合并两个XML文件 -
sunnyting:
蛮靠谱!解决问题哈!
Android控制屏幕方向的改变
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.
|
发表评论
-
Android获取sdcard信息
2011-04-04 22:11 39841>实例代码: if (Environ ... -
Android获取通话状态
2011-04-04 21:08 72861>添加读取手机状态的权限 <uses-pe ... -
Android 系统服务getSystemService
2011-04-02 21:04 3786public Object getSystemService ... -
Android获取、设置Wifi状态
2011-04-02 19:14 54031>获得WifiManager WifiManager ... -
Android获取、设置桌面
2011-04-02 18:57 14971>添加权限 <uses-permission ... -
Android SQLite学习工具
2011-03-27 19:01 1208Android自带数据库SQLite,是一个超级迷你,但是五脏 ... -
自定义程序实现Android EditText只允许输入指定字符
2011-03-24 19:18 7265程序设计的很多地方都要用到一个小技术:指定文本框的输入类型。即 ... -
Android EditText禁止输入中文字符
2011-03-24 16:51 27357只允许EditText输入数字或者email格式字符是非常简 ... -
Android控制屏幕方向的改变
2011-03-19 16:05 9594目前大多数手机都支持 重力感应 ,随之而来的就是屏幕 ... -
Android 自定义拨打电话程序段
2011-03-17 14:09 1948strInput = "13912345 ... -
java合并两个XML文件
2010-09-13 15:59 9920package cs.edu.hust.cs.j2 ... -
sss
2010-09-09 12:09 0getWindow().setFlags(WindowMana ... -
android 邮件地址正则表达式
2010-09-07 20:24 1837public static boolean isEma ... -
正则表达式需要转义的字符
2010-09-07 20:08 8247$ ---> \$ ( ---> \ ... -
Android手机号码判断正则表达式
2010-09-07 19:26 9951public static boolean isPho ... -
Android发送短信与邮件
2010-09-07 19:14 3122发送短信: 注意引入包的时候,应该是: import andr ... -
Android TabHost动态加载内容总结
2010-09-02 16:16 5765前面用继承TabActivity的方法很好的完成了,TabHo ... -
Android TabHost使用、动态加载内容
2010-09-02 16:03 7598使用TabHost有两种办法 1.在layout的xml文件里 ... -
Android Activity间传递对象startActivityForResult、onActivityResult、setResult总结
2010-09-01 13:12 4834前面做了在Activity之间传递参数的测试。 setResu ... -
Android Activity间传递自定义类的对象
2010-09-01 12:53 13622有很多时候都需要在不同的Activity之间传递数据。 实现方 ...
相关推荐
获取SIM卡信息: Android:基于TelephonyManager iOS:基于CoreTelephony
本文实例讲述了Android获取手机SIM卡运营商信息的方法,对于Android程序设计有非常实用的价值。分享给大家供大家参考之用。具体方法如下: 主要功能代码如下: /** * 获取SIM卡运营商 * * @param context * @...
/** 获取SIM卡的IMSI码 * SIM卡唯一标识:IMSI 国际移动用户识别码(IMSI:International Mobile Subscriber Identification Number)是区别移动用户的标志, * 储存在SIM卡中,可用于区别移动用户的有效信息。IMSI...
摘要:Java源码,Android源码,手机管理器,SIM卡 TelephonyManager android 手机程序源代码,检测手机运营商及SIM卡信息,是Android系统的手机管理器,可检测出您手机的设备号、软件版本、网络运营商代号及名称、手机...
读取sim卡的序列号,保存起来,一旦sim发生变更了,认为是小偷的sim卡,发出警告 读取sim卡序列号 获取TelephonyManager对象,通过getSystemService(TELEPHONY_SERVICE) 调用TelephonyManager对象的...
如何在Android上获取本机电话号码,目前Android上提供了一个API可以读取早期SIM卡上固化的号码, 代码如下:private String getPhoneNumber(){ TelephonyManager mTelephonyMgr; mTelephonyMgr = (TelephonyManager...
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类的方法。分享给大家供大家参考。具体如下: TelephonyManager类主要提供了一系列用于访问与手机通讯相关的状态和信息的get方法。其中包括手机SIM的状态和信息、电信网络的...
获取手机SIM卡联系人,支持添加、修改、删除联系人,快速查找联系人,通讯等操作 2、电池管理 可以显示电池当前的电量,温度,电压,电池充电时进行实时保护; 3、照相机 可以调焦进行拍照,开启和关闭闪关灯,...
React Native Carrier Info React Native 模块桥接以获取有关用户的家庭蜂窝服务提供商的信息。 使用以下本机类: iOS CTTelephonyNetworkInfo CTCarrier Android TelephonyManager 版本 1.0.0 Android 支持 ...
在最近的开发中需要获取到SIM卡的网络状态,在源码中看到一个方法: TelephonyManager tm =(TelephonyManager)context.getSystemService(TELEPHONY_SERVICE); state =tm.getDataNetworkType(); 但是报错了Call ...