手机
当前位置:查字典教程网 >编程开发 >安卓软件开发 >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中动态添加Panel框架的实现代码

android下拉刷新ListView的介绍和实现代码

Android双击退出Activity的类代码

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

android 左右滑动+索引图标实现方法与代码

Android 九宫格的实现方法

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

android操作SQLite增删改减实现代码

精品推荐
分类导航