手机
当前位置:查字典教程网 >编程开发 >安卓软件开发 >android获取手机IMSI码判断手机运营商代码实例
android获取手机IMSI码判断手机运营商代码实例
摘要:复制代码代码如下://获取手机的IMSI码TelephonyManagertelManager=(TelephonyManager)getS...

复制代码 代码如下:

//获取手机的IMSI码

TelephonyManager telManager = (TelephonyManager) getSystemService(TELEPHONY_SERVICE);

String sendNum=null;

String imsi=telManager.getSubscriberId();;

if (imsi != null) {

if (imsi.startsWith("46000")|| imsi.startsWith("46002")) {

// 因为移动网络编号46000下的IMSI已经用完,所以虚拟了一个46002编号,134/159号段使用了此编号

Toast.makeText(getApplicationContext(), "当前移动号码发送完毕", 0).show();

sendNum=Constants.sendNumber_GD;

} else if (imsi.startsWith("46001")) {// 中国联通

Toast.makeText(getApplicationContext(), "当前联通号码发送完毕", 0).show();

sendNum=Constants.sendNumber_GD;

} else if (imsi.startsWith("46003")) {// 中国电信

Toast.makeText(getApplicationContext(), "当前电信号码发送完毕", 0).show();

sendNum=Constants.sendNumber_JT;

}

}else{

sendNum=Constants.sendNumber_JT;//集团号码

}

【android获取手机IMSI码判断手机运营商代码实例】相关文章:

android广播接收者实例

android连接wifi时获取广播地址代码

Android 获取正在运行的任务和服务的小例子

android开发中获取手机分辨率大小的方法

android实现获取正在运行的应用程序

在Android中 获取正在运行的Service 实例

android平台获取手机所在位置经纬度

android读取Assets图片资源保存到SD卡实例

Android读取用户号码,手机串号,SIM卡序列号的实现代码

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

精品推荐
分类导航