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

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

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

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

android手机获取gps和基站的经纬度地址实现代码

Android双击退出Activity的类代码

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

android ListView和GridView拖拽移位实现代码

Android裁剪图片为圆形图片的实现原理与代码

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

精品推荐
分类导航