获取IMSI


国际移动用户识别码(IMSI:International Mobile Subscriber Identification Number)是区别移动用户的标志,储存在SIM卡中,可用于区别移动用户的有效信息。固名思义,他与IMEI的区别是,IMEI是区分设备的。与设备相关。

@Nullable
public static String imsi(Context context) {
    if (null == context) {
        return null;
    }

    TelephonyManager telephonyManager = (TelephonyManager)context.getSystemService(Context.TELEPHONY_SERVICE);
    if (telephonyManager != null) {
        try {
            return telephonyManager.getSubscriberId();
        } catch (SecurityException e) {
            Logger.e(TAG,e);
        }
    }
    return null;
}
相关标签

扫一扫

在手机上阅读