標籤:ase text opera equal androi one start tor android
直接上代碼:
/** * 擷取SIM卡電訊廠商 * * @param context * @return */public static String getOperators(Context context) {TelephonyManager tm = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);String operator = null;String IMSI = tm.getSubscriberId();if (IMSI == null || IMSI.equals("")) {return operator;}if (IMSI.startsWith("46000") || IMSI.startsWith("46002")) {operator = "中國移動";} else if (IMSI.startsWith("46001")) {operator = "中國聯通";} else if (IMSI.startsWith("46003")) {operator = "中國電信";}return operator;}
/** * 手機型號 * * @return */public static String getPhoneModel() {return android.os.Build.MODEL;}/** * 系統版本號碼 * * @return */public static String getSystemVersion() {return android.os.Build.VERSION.RELEASE;}許可權:
<uses-permission android:name="android.permission.READ_PHONE_STATE"/>
Android 擷取手機SIM卡電訊廠商