手机
当前位置:查字典教程网 >编程开发 >安卓软件开发 >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 ListView和GridView拖拽移位实现代码

Android中获得手机屏幕大小实现代码

在Android中动态添加Panel框架的实现代码

Android 使用Intent传递数据的实现思路与代码

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

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

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

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

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

Android在OnCreate中获取控件的宽度和高度的实现代码

精品推荐
分类导航