Android(安卓)判断SIM卡属于哪个移动运营商
16lz
2021-12-04
Android这样获取本机网络提供商呢?请看下面代码:
[java] view plain copy- publicStringgetProvidersName()
- {
- Stringstr="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="中国联通";
- elseif(this.IMSI.startsWith("46003"))
- str="中国电信";
- }
- catch(ExceptionlocalException)
- {
- localException.printStackTrace();
- }
- returnstr;
- }
注意申明:
[java] view plain copy- this.telephonyManager=((TelephonyManager)paramContext.getSystemService("phone"));
更多相关文章
- Android(安卓)获取基站信息
- android通过代码来开启和关闭移动网络
- 中国电信已加盟Android阵营
- Google放弃“不做恶”? 意欲垄断Android
- 中国移动互联网:清一色的NOKIA!
- Android下编写HelloWorld
- 获取andrid apn信息
- Android获取运营商信息
- Android通过代码打开和关闭网络连接