手机
当前位置:查字典教程网 >编程开发 >安卓软件开发 >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中获得手机屏幕大小实现代码

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

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

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

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

Android获取SD卡上图片和视频的缩略图

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

Android 九宫格的实现方法

android快捷简单的实现音乐播放器

android panellistview 圆角实现代码

精品推荐
分类导航