/** * 获取手机卡类型,移动、联通、电信 * */ private static int getMobileType(Context context) { int type = 0; TelephonyManager iPhoneManager = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE); String iNumeric = iPhoneManager.getSimOperator(); if (iNumeric.length() > 0) { if (iNumeric.equals("46000") || iNumeric.equals("46002")) { // 中国移动 } else if (iNumeric.equals("46001")) { // 中国联通 } else if (iNumeric.equals("46003")) { // 中国电信 } } }
|