手机IMSI码规则更新-通过IMSI判断运营商的方法
2020-06-24 14:51
316 查看
更新运营商判断规则:
中国移动系统使用00、02、04、07,中国联通GSM系统使用01、06、09,中国电信CDMA系统使用03、05、电信4G使用11,中国铁通系统使用20。
注意:getSimOperator方法不需要READ_PHONE_STATE权限
/** * 返回手机运营商名称 * 中国移动系统使用00、02、04、07,中国联通GSM系统使用01、06、09,中国电信CDMA系统使用03、05、电信4G使用11,中国铁通系统使用20。*/ public void getMobileOperatorName() { TelephonyManager telManager = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE); //getSimOperator方法不需要READ_PHONE_STATE权限 String operator = telManager.getSimOperator(); Log.d(TAG, "operator:" + operator); if (operator != null) { if (operator.equals("46000") || operator.equals("46002") || operator.equals("46004") || operator.equals("46007")) { //中国移动 Log.d(TAG, "中国移动"); } else if (operator.equals("46001") || operator.equals("46006") || operator.equals("46009")) { //中国联通 Log.d(TAG, "中国联通"); } else if (operator.equals("46003") || operator.equals("46005") || operator.equals("46011")) { //中国电信 Log.d(TAG, "中国电信"); } else if (operator.equals("46020")) { Log.d(TAG, "中国铁通"); } } }
相关文章推荐
- 通过IMSI判断运营商的方法
- android获取手机IMSI码判断手机运营商代码实例
- 通过IMSI运营商判断[Android]
- iphone 通过获取IMSI判断运营商
- [Android Pro] 通过IMSI判断手机是移动、联通、电信
- iphone 通过获取IMSI判断运营商
- iphone 通过获取IMSI判断运营商
- 一种通过GPS判断手机漫游状态实现自动搜索连接服务商的方法
- iphone 通过获取IMSI判断运营商
- iphone 通过获取IMSI判断运营商
- iphone 通过获取IMSI判断运营商
- iphone 通过获取IMSI判断运营商
- Android通过获取Ip的方法判断手机是否联网
- PHP判断客户端是PCweb端还是移动手机端方法
- Vue.js 通过jQuery ajax获取数据实现更新后重新渲染页面的方法
- 在进行C#编程时候,有的时候我们需要判断一个字符串是否是数字字符串,我们可以通过以下两种方法来实现。 【方法一】:使用 try{} catch{} 语句。 我们可以在try语句块中试图
- 通过userAgent判断手机浏览器类型
- Android判断用户是平板还是手机的方法
- android平台获取手机IMSI,IMEI ,序列号,和 手机号的方法
- PHP实现通过中文字符比率来判断垃圾评论的方法