获取android设备的各种系统信息

获取android设备的各种系统信息:
TelephonyManager tm = (TelephonyManager) this.getSystemService(Context.TELEPHONY_SERVICE);

String imei = tm.getDeviceId();//移动设备国际辨识码
String imsi = tm.getSubscriberId();//国际移动用户识别码
String tel = tm.getLine1Number();//电话号码
        
String model =  android.os.Build.MODEL;//手机型号
String sdk = android.os.Build.VERSION.SDK;//SDK版本    
String release = android.os.Build.VERSION.RELEASE;//系统版本

//根据IMSI号码识别移动供应商
public String getProvidersName(String IMSI) {
    String ProvidersName = null;
    // IMSI号前面3位460是国家,紧接着后面2位00 02是中国移动,01是中国联通,03是中国电信。
    if (IMSI.startsWith("46000") || IMSI.startsWith("46002")) {
        ProvidersName = "中国移动";
    } else if (IMSI.startsWith("46001")) {
        ProvidersName = "中国联通";
    } else if (IMSI.startsWith("46003")) {
        ProvidersName = "中国电信";
    }
    return ProvidersName;
}

猜你喜欢

转载自blog.csdn.net/xifei66/article/details/64122302