代码如下:[java]public String getProvidersName() { String str = "N/A
代码如下:
[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"));
就这么简单。。。。
--结束END--
本文标题: Android 判断SIM卡属于哪个移动运营商的实现代码
本文链接: https://www.lsjlt.com/news/27736.html(转载时请注明来源链接)
有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341
下载Word文档到电脑,方便收藏和打印~
2024-01-21
2023-10-28
2023-10-28
2023-10-27
2023-10-27
2023-10-27
2023-10-27
回答
回答
回答
回答
回答
回答
回答
回答
回答
回答
0