·您现在的位置: 云翼网络 >> 文章中心 >> 网站建设 >> app软件开发 >> Android开发 >> Android 判断SIM卡属于哪个移动运营商的实现代码

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

作者:佚名      Android开发编辑:admin      更新时间:2022-07-23

复制代码 代码如下:
[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"));

就这么简单。。。。