您的位置:首页 > 移动开发 > Android开发

Android 判断SIM卡属于哪个移动运营商

2016-04-09 23:55 471 查看
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;    

 }    
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  android