手机
当前位置:查字典教程网 >编程开发 >安卓软件开发 >Android 判断SIM卡属于哪个移动运营商的实现代码
Android 判断SIM卡属于哪个移动运营商的实现代码
摘要:复制代码代码如下:[java]publicStringgetProvidersName(){Stringstr="N/A";try{this...

复制代码 代码如下:

[java]

public String getProvidersName()

{

String str = "N/A";

try

{

this.IMSI = this.telephonyManager.getSubscriberId();

System.out.println(this.IMSI);

if (this.IMSI.startsWith("46000"))

str = "中国移动"; break;

if (this.IMSI.startsWith("46002"))

str = "中国移动"; break ;

if (this.IMSI.startsWith("46001"))

str = "中国联通";

else if (this.IMSI.startsWith("46003"))

str = "中国电信";

}

catch (Exception localException)

{

localException.printStackTrace();

}

return str;

}

注意申明:

[java]

复制代码 代码如下:

this.telephonyManager = ((TelephonyManager)paramContext.getSystemService("phone"));

就这么简单。。。。

【Android 判断SIM卡属于哪个移动运营商的实现代码】相关文章:

android md5加密与rsa加解密实现代码

Android画图并保存图片的具体实现代码

Android 九宫格的实现方法

Android中判断网络连接是否可用及监控网络状态

Android仿UC底部菜单栏实现原理与代码

android书架效果实现原理与代码

基于Android中dp和px之间进行转换的实现代码

Android Intent启动别的应用实现方法

android获取屏幕的长与宽实现代码(手写)

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

精品推荐
分类导航