源码网商城,靠谱的源码在线交易网站 我的订单 购物车 帮助

源码网商城

Android 判断SIM卡属于哪个移动运营商的实现代码

  • 时间:2021-03-25 19:38 编辑: 来源: 阅读:
  • 扫一扫,手机访问
摘要:Android 判断SIM卡属于哪个移动运营商的实现代码
[u]复制代码[/u] 代码如下:
[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]
[u]复制代码[/u] 代码如下:
this.telephonyManager = ((TelephonyManager)paramContext.getSystemService("phone"));
就这么简单。。。。
  • 全部评论(0)
联系客服
客服电话:
400-000-3129
微信版

扫一扫进微信版
返回顶部