/** * 获取当前的运营商 * * @param context * @return 运营商名字 */ public static String getOperator(Context context) { String ProvidersName = ""; TelephonyManager telephonyManager = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE); String IMSI = telephonyManager.getSubscriberId(); Log.i("qweqwes", "运营商代码" + IMSI); if (IMSI != null) { if (IMSI.startsWith("46000") || IMSI.startsWith("46002") || IMSI.startsWith("46007")) { ProvidersName = "中国移动"; } else if (IMSI.startsWith("46001") || IMSI.startsWith("46006")) { ProvidersName = "中国联通"; } else if (IMSI.startsWith("46003")) { ProvidersName = "中国电信"; } return ProvidersName; } else { return "没有获取到sim卡信息"; } }
android 获取手机运营商名字
最新推荐文章于 2021-11-11 01:05:24 发布