android sim iso,android – 意外的telephonyManager.getSimCountryIso()行为

您可以使用MCC MNC获取SIM卡国家/地区,它是SIM配置的,与您所在的网络无关.

Configuration config = getResources().getConfiguration();

int countryCode = config.mcc;

您可以在此处找到MCC列表MccTable.java

例如,西班牙是214,法国是208

MCC should work on all GSM devices with SIM card but it is unreliable on CDMA networks

if (telephonyManager.getPhoneType() == TelephonyManager.PHONE_TYPE_CDMA) {

Class> c = Class.forName("android.os.SystemProperties");

Method get = c.getMethod("get", String.class);

// Gives MCC + MNC

String homeOperator = ((String) get.invoke(c, "ro.cdma.home.operator.numeric"));

String country = homeOperator.substring(0, 3); // the last three digits is MNC

} else {

Configuration config = getResources().getConfiguration();

int countryCode = config.mcc;

}

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/278896.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

火狐 增强查找工具栏_在“提示”框中:简单的IE至Firefox同步,轻松的Windows工具栏和识别USB电缆...

火狐 增强查找工具栏() Every week we tip into our mail bag and share great tips from your fellow readers. This week we’re looking at an easy way to sync your bookmarks between IE and Firefox, using simple Windows toolbars, and a clever way to ID USB cables…

day22 模块-collections,time,random,pickle,shelve等

一、引入模块的方式: 1. 认识模块 模块可以认为是一个py文件. 模块实际上是我们的py文件运行后的名称空间 导入模块: 1. 判断sys.modules中是否已经导入过该模块 2. 开辟一个内存 3. 在这个内存中执行该py文件 4. 给这个内存起个名字, 一般用的是py文件的名字。返回…

基于Redis实现分布式锁,避免重复执行定时任务

Spring提供了定时任务的功能,但是在多个实例的集群中,会出现定时任务重复执行多次的情况。 使用Qutaz框架自带的分布式定时任务可以很好的解决这个问题,但是讲道理功能有些过于强大,对于需求不高,乃至可以一定程度上允…

Input Director使用一个键盘和鼠标即可控制多台Windows计算机

The problem is having two or more PC’s and having to go back and forth between workstation. Input Director solves the problem by allowing you to control multiple Windows systems with only one keyboard and mouse on the Master PC. 问题是拥有两台或更多台PC…

viper4android 生效,另一种让V4a音效在Poweramp上生效的方法

该楼层疑似违规已被系统折叠 隐藏此楼查看此楼本人按照网上的方法进Poweramp设置—音频—高级选项—直接音量控制—不打勾后 V4a音效没有生效 我又把V4a音效兼容模式里的正常模式切换成为兼容模式 结果还是不行......后来我郁闷了三天三夜有一天我去了v4a官网论坛看到了admin帖…

[学习笔记]状压dp

状压 \(dp\) 1、[SDOI2009]Bill的挑战 \(f[i][j]\) 表示匹配到字符串的第 \(i\) 位状态为 \(j\) 的方案数 那么方程就很明显了&#xff0c;每次枚举第 \(i\) 位的字母 \(alpha\) 然后 \(O(n)\) 判断就好了 时间复杂度 \(O(26Tlen2^nn)\) \(Code\ Below:\) #include <bits/st…

excel导入csv文件_如何将包含以0开头的列的CSV文件导入Excel

excel导入csv文件Microsoft Excel will automatically convert data columns into the format that it thinks is best when opening comma-separated data files. For those of us that don’t want our data changed, we can change that behavior. Microsoft Excel将在打开…

MySQL之进化篇

MySQL之实用篇 MySQL之牛刀小试 子查询是指出现在其他SQL语句内的SELECT子句. 例如: SELECT * FROM t1 WHERE column1 (SELECT column2 FROM t2) 其中 SELECT * FRIN t1 称为outerQuery SELECT column2 FROM t2 称为subQuery 注意:子查询指嵌套在查询内部,且必须始终出现在圆括…

android 9.0新ui,SystemUI分析(Android9.0)

8种机械键盘轴体对比本人程序员&#xff0c;要买一个写代码的键盘&#xff0c;请问红轴和茶轴怎么选&#xff1f;一、SystemUI组成SystemUI是Android的系统界面&#xff0c;包括状态栏statusbar、锁屏keyboard、任务列表recents等等&#xff0c;都继承于SystemUI这个类&#xf…

WMI技术介绍和应用——WMI概述

https://blog.csdn.net/breaksoftware/article/details/8424317转载于:https://www.cnblogs.com/diyunpeng/p/9982885.html

解决App启动时白屏的问题

第一次 03-25 11:02:34.431 6908-6908/com.newenergyjinfu.jytz D/App: before_onCreate: 239 03-25 11:02:34.513 6908-6908/com.newenergyjinfu.jytz D/App: after_initOkGo( initPicasso): 316 03-25 11:02:34.570 6908-6908/com.newenergyjinfu.jytz D/App: after_ J…

chromebook刷机_如何为不支持Chrome操作系统的网站欺骗Chromebook用户代理

chromebook刷机Not all browsers handle websites the same, and if they don’t support your operating system or browser, you could be denied access. Luckily, you can spoof the user agent on Chrome OS to make it look like you use a completely different system.…

什么时候可以升级HarmonyOS,华为鸿蒙OS即将迎来升级 手机版本或仍需时间

原标题&#xff1a;华为鸿蒙OS即将迎来升级 手机版本或仍需时间在2019年的华为开发者大会上&#xff0c;华为消费者业务CEO余承东正式对外发布了HarmonyOS。时隔一年后&#xff0c;华为开发者大会2020即将拉开帷幕。此次大会&#xff0c;HarmonyOS无疑仍会是重头戏之一&#xf…

Shell_mysql命令以及将数据导入Mysql数据库

连接MYSQL数据库 mysql -h${db_ip} -u${db_user} -p${db_pawd} -P${db_port} -D${db_name} -s -e "${sql}" db_ip&#xff1a;主机地址 db_user &#xff1a;数据库用户名 db_pwd&#xff1a;密码 db_port&#xff1a;端口号 db_name&#xff1a;数据库名称 sql&…

cocos android-1,cocos2dx在windows下开发,编译到android上(1)

转自&#xff1a;http://www.2cto.com/kf/201205/130697.html下面我给大家介绍下&#xff0c;用vs2010开发cocos2dx&#xff0c;然后如何使其编译到android上。步骤如下&#xff1a;1、必要条件&#xff0c;你的eclipse能把代码编译到安卓手机或虚拟机上&#xff0c;如果这一步…

中药ppi网络图太杂乱_太杂乱了吗? 这是您的iPhone,iPad,Android或台式机的15张简约壁纸...

中药ppi网络图太杂乱Busy wallpaper images don’t work very well on your iPhone, iPad, or any device where you need to have lots of icons on the screen. Here’s a set of minimalistic wallpaper images that won’t clutter up your desktop. 繁忙的墙纸图像在iPhon…

算法61---两个字符串的最小ASCII删除和【动态规划】

一、题目&#xff1a; 给定两个字符串s1, s2&#xff0c;找到使两个字符串相等所需删除字符的ASCII值的最小和。 示例 1: 输入: s1 "sea", s2 "eat" 输出: 231 解释: 在 "sea" 中删除 "s" 并将 "s" 的值(115)加入总和。 在…

android设置时间widget,【Android】时间与日期Widget(DatePicker 与 TimePicker)

public class Activity01 extends Activity{TextViewm_TextView;//声明dataPickerDatePickerm_DatePicker;//声明TimePickerTimePickerm_TimePicker;Button m_dpButton;Button m_tpButton;//java中的Calendar类Calendar c;/** Called when the activity is first created. */Ov…

初学者java学习计划_初学者:计划在Windows 7 Media Center中录制直播电视的时间

初学者java学习计划If you’re a new user to Windows 7 Media Center you know it can act as a DVR and pause or record Live TV. You can set up a schedule for it to record your favorite TV programs as well. 如果您是Windows 7 Media Center的新用户&#xff0c;则知…

双数据源配置

从此抄录&#xff1a;https://blog.csdn.net/ll535299/article/details/78203634 1、先配置两个数据源&#xff0c;附上主要代码&#xff0c;给自己回忆&#xff0c;详解见开头链接 <!-- 配置数据源 --> <bean id"szDS" class"com.alibaba.druid.pool.…