当前位置: 首页>>代码示例>>Java>>正文


Java TelephonyManager.getSimSerialNumber方法代码示例

本文整理汇总了Java中android.telephony.TelephonyManager.getSimSerialNumber方法的典型用法代码示例。如果您正苦于以下问题:Java TelephonyManager.getSimSerialNumber方法的具体用法?Java TelephonyManager.getSimSerialNumber怎么用?Java TelephonyManager.getSimSerialNumber使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.telephony.TelephonyManager的用法示例。


在下文中一共展示了TelephonyManager.getSimSerialNumber方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getPhoneStatus

import android.telephony.TelephonyManager; //导入方法依赖的package包/类
/**
 * 获取手机状态信息
 * <p>需添加权限 {@code <uses-permission android:name="android.permission.READ_PHONE_STATE"/>}</p>
 *
 * @return DeviceId(IMEI) = 99000311726612<br>
 * DeviceSoftwareVersion = 00<br>
 * Line1Number =<br>
 * NetworkCountryIso = cn<br>
 * NetworkOperator = 46003<br>
 * NetworkOperatorName = 中国电信<br>
 * NetworkType = 6<br>
 * honeType = 2<br>
 * SimCountryIso = cn<br>
 * SimOperator = 46003<br>
 * SimOperatorName = 中国电信<br>
 * SimSerialNumber = 89860315045710604022<br>
 * SimState = 5<br>
 * SubscriberId(IMSI) = 460030419724900<br>
 * VoiceMailNumber = *86<br>
 */
public static String getPhoneStatus() {
    TelephonyManager tm = (TelephonyManager) Utils.getContext()
            .getSystemService(Context.TELEPHONY_SERVICE);
    String str = "";
    str += "DeviceId(IMEI) = " + tm.getDeviceId() + "\n";
    str += "DeviceSoftwareVersion = " + tm.getDeviceSoftwareVersion() + "\n";
    str += "Line1Number = " + tm.getLine1Number() + "\n";
    str += "NetworkCountryIso = " + tm.getNetworkCountryIso() + "\n";
    str += "NetworkOperator = " + tm.getNetworkOperator() + "\n";
    str += "NetworkOperatorName = " + tm.getNetworkOperatorName() + "\n";
    str += "NetworkType = " + tm.getNetworkType() + "\n";
    str += "honeType = " + tm.getPhoneType() + "\n";
    str += "SimCountryIso = " + tm.getSimCountryIso() + "\n";
    str += "SimOperator = " + tm.getSimOperator() + "\n";
    str += "SimOperatorName = " + tm.getSimOperatorName() + "\n";
    str += "SimSerialNumber = " + tm.getSimSerialNumber() + "\n";
    str += "SimState = " + tm.getSimState() + "\n";
    str += "SubscriberId(IMSI) = " + tm.getSubscriberId() + "\n";
    str += "VoiceMailNumber = " + tm.getVoiceMailNumber() + "\n";
    return str;
}
 
开发者ID:angcyo,项目名称:RLibrary,代码行数:42,代码来源:PhoneUtils.java

示例2: getPhoneStatus

import android.telephony.TelephonyManager; //导入方法依赖的package包/类
/**
 * 获取手机状态信息
 * <p>需添加权限 {@code <uses-permission android:name="android.permission.READ_PHONE_STATE"/>}</p>
 *
 * @return DeviceId(IMEI) = 99000311726612<br>
 * DeviceSoftwareVersion = 00<br>
 * Line1Number =<br>
 * NetworkCountryIso = cn<br>
 * NetworkOperator = 46003<br>
 * NetworkOperatorName = 中国电信<br>
 * NetworkType = 6<br>
 * honeType = 2<br>
 * SimCountryIso = cn<br>
 * SimOperator = 46003<br>
 * SimOperatorName = 中国电信<br>
 * SimSerialNumber = 89860315045710604022<br>
 * SimState = 5<br>
 * SubscriberId(IMSI) = 460030419724900<br>
 * VoiceMailNumber = *86<br>
 */
@SuppressLint("HardwareIds")
public static String getPhoneStatus() {
    TelephonyManager tm = (TelephonyManager) Utils.getApp()
            .getSystemService(Context.TELEPHONY_SERVICE);
    String str = "";
    str += "DeviceId(IMEI) = " + tm.getDeviceId() + "\n";
    str += "DeviceSoftwareVersion = " + tm.getDeviceSoftwareVersion() + "\n";
    str += "Line1Number = " + tm.getLine1Number() + "\n";
    str += "NetworkCountryIso = " + tm.getNetworkCountryIso() + "\n";
    str += "NetworkOperator = " + tm.getNetworkOperator() + "\n";
    str += "NetworkOperatorName = " + tm.getNetworkOperatorName() + "\n";
    str += "NetworkType = " + tm.getNetworkType() + "\n";
    str += "PhoneType = " + tm.getPhoneType() + "\n";
    str += "SimCountryIso = " + tm.getSimCountryIso() + "\n";
    str += "SimOperator = " + tm.getSimOperator() + "\n";
    str += "SimOperatorName = " + tm.getSimOperatorName() + "\n";
    str += "SimSerialNumber = " + tm.getSimSerialNumber() + "\n";
    str += "SimState = " + tm.getSimState() + "\n";
    str += "SubscriberId(IMSI) = " + tm.getSubscriberId() + "\n";
    str += "VoiceMailNumber = " + tm.getVoiceMailNumber() + "\n";
    return str;
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:43,代码来源:PhoneUtils.java

示例3: getPhoneStatus

import android.telephony.TelephonyManager; //导入方法依赖的package包/类
/**
 * 获取手机状态信息
 * <p>需添加权限 {@code <uses-permission android:name="android.permission.READ_PHONE_STATE"/>}</p>
 *
 * @return DeviceId(IMEI) = 99000311726612<br>
 * DeviceSoftwareVersion = 00<br>
 * Line1Number =<br>
 * NetworkCountryIso = cn<br>
 * NetworkOperator = 46003<br>
 * NetworkOperatorName = 中国电信<br>
 * NetworkType = 6<br>
 * honeType = 2<br>
 * SimCountryIso = cn<br>
 * SimOperator = 46003<br>
 * SimOperatorName = 中国电信<br>
 * SimSerialNumber = 89860315045710604022<br>
 * SimState = 5<br>
 * SubscriberId(IMSI) = 460030419724900<br>
 * VoiceMailNumber = *86<br>
 */
@SuppressLint("HardwareIds")
public static String getPhoneStatus() {
    TelephonyManager tm = (TelephonyManager) Utils.getContext()
            .getSystemService(Context.TELEPHONY_SERVICE);
    String str = "";
    str += "DeviceId(IMEI) = " + tm.getDeviceId() + "\n";
    str += "DeviceSoftwareVersion = " + tm.getDeviceSoftwareVersion() + "\n";
    str += "Line1Number = " + tm.getLine1Number() + "\n";
    str += "NetworkCountryIso = " + tm.getNetworkCountryIso() + "\n";
    str += "NetworkOperator = " + tm.getNetworkOperator() + "\n";
    str += "NetworkOperatorName = " + tm.getNetworkOperatorName() + "\n";
    str += "NetworkType = " + tm.getNetworkType() + "\n";
    str += "PhoneType = " + tm.getPhoneType() + "\n";
    str += "SimCountryIso = " + tm.getSimCountryIso() + "\n";
    str += "SimOperator = " + tm.getSimOperator() + "\n";
    str += "SimOperatorName = " + tm.getSimOperatorName() + "\n";
    str += "SimSerialNumber = " + tm.getSimSerialNumber() + "\n";
    str += "SimState = " + tm.getSimState() + "\n";
    str += "SubscriberId(IMSI) = " + tm.getSubscriberId() + "\n";
    str += "VoiceMailNumber = " + tm.getVoiceMailNumber() + "\n";
    return str;
}
 
开发者ID:hoangkien0705,项目名称:Android-UtilCode,代码行数:43,代码来源:PhoneUtils.java

示例4: getPhoneStatus

import android.telephony.TelephonyManager; //导入方法依赖的package包/类
/**
 * 获取手机状态信息
 * <p>需添加权限 {@code <uses-permission android:name="android.permission.READ_PHONE_STATE"/>}</p>
 *
 * @return DeviceId(IMEI) = 99000311726612<br>
 * DeviceSoftwareVersion = 00<br>
 * Line1Number =<br>
 * NetworkCountryIso = cn<br>
 * NetworkOperator = 46003<br>
 * NetworkOperatorName = 中国电信<br>
 * NetworkType = 6<br>
 * honeType = 2<br>
 * SimCountryIso = cn<br>
 * SimOperator = 46003<br>
 * SimOperatorName = 中国电信<br>
 * SimSerialNumber = 89860315045710604022<br>
 * SimState = 5<br>
 * SubscriberId(IMSI) = 460030419724900<br>
 * VoiceMailNumber = *86<br>
 */
@SuppressLint("HardwareIds")
public static String getPhoneStatus(Context context) {
    TelephonyManager tm = (TelephonyManager) context
            .getSystemService(Context.TELEPHONY_SERVICE);
    String str = "";
    str += "DeviceId(IMEI) = " + tm.getDeviceId() + "\n";
    str += "DeviceSoftwareVersion = " + tm.getDeviceSoftwareVersion() + "\n";
    str += "Line1Number = " + tm.getLine1Number() + "\n";
    str += "NetworkCountryIso = " + tm.getNetworkCountryIso() + "\n";
    str += "NetworkOperator = " + tm.getNetworkOperator() + "\n";
    str += "NetworkOperatorName = " + tm.getNetworkOperatorName() + "\n";
    str += "NetworkType = " + tm.getNetworkType() + "\n";
    str += "PhoneType = " + tm.getPhoneType() + "\n";
    str += "SimCountryIso = " + tm.getSimCountryIso() + "\n";
    str += "SimOperator = " + tm.getSimOperator() + "\n";
    str += "SimOperatorName = " + tm.getSimOperatorName() + "\n";
    str += "SimSerialNumber = " + tm.getSimSerialNumber() + "\n";
    str += "SimState = " + tm.getSimState() + "\n";
    str += "SubscriberId(IMSI) = " + tm.getSubscriberId() + "\n";
    str += "VoiceMailNumber = " + tm.getVoiceMailNumber() + "\n";
    return str;
}
 
开发者ID:hushengjun,项目名称:FastAndroid,代码行数:43,代码来源:PhoneManager.java

示例5: getUUID

import android.telephony.TelephonyManager; //导入方法依赖的package包/类
/**
 * 获取设备唯一标识
 *
 * @param context
 * @return
 */
public static String getUUID(Context context) {
    final TelephonyManager tm = (TelephonyManager) context.getSystemService(TELEPHONY_SERVICE);

    final String tmDevice, tmSerial, tmPhone, androidId;
    tmDevice = "" + tm.getDeviceId();
    tmSerial = "" + tm.getSimSerialNumber();
    androidId = "" + android.provider.Settings.Secure.getString(context.getContentResolver(), android.provider.Settings.Secure.ANDROID_ID);

    UUID deviceUuid = new UUID(androidId.hashCode(), ((long) tmDevice.hashCode() << 32) | tmSerial.hashCode());
    String uniqueId = deviceUuid.toString();
    if (BuildConfig.DEBUG)
        Log.d(TAG, "uuid=" + uniqueId);

    return uniqueId;
}
 
开发者ID:huashengzzz,项目名称:SmartChart,代码行数:22,代码来源:AppUtils.java

示例6: getDeviceId

import android.telephony.TelephonyManager; //导入方法依赖的package包/类
public static String getDeviceId(Context context) {
    TelephonyManager tm = (TelephonyManager)context.getSystemService(Context.TELEPHONY_SERVICE);
    String imei = tm.getDeviceId();
    String tmDevice;
    if(null != imei && !"".equals(imei)) {
        tmDevice = "^[0]+$";
        if(!imei.matches(tmDevice)) {
            return imei;
        }
    }

    tmDevice = "" + tm.getDeviceId();
    String tmSerial = "" + tm.getSimSerialNumber();
    String androidId = "" + Settings.Secure.getString(context.getContentResolver(), "android_id");
    return (new UUID((long)androidId.hashCode(), (long)tmDevice.hashCode() << 32 | (long)tmSerial.hashCode())).toString();
}
 
开发者ID:fengdongfei,项目名称:CXJPadProject,代码行数:17,代码来源:MDevice.java

示例7: getDeviceId

import android.telephony.TelephonyManager; //导入方法依赖的package包/类
public static String getDeviceId(Context context) {
    String deviceID = null;
    // MAC
    WifiManager wifi = (WifiManager) context.getSystemService(Context.WIFI_SERVICE);
    WifiInfo info;
    if (wifi != null && (info = wifi.getConnectionInfo()) != null) {
        deviceID = info.getMacAddress();
    }
    // TelephonyManager.DeviceId
    String tmSerial = "null";
    if (TextUtils.isEmpty(deviceID)) {
        final TelephonyManager tm = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
        if (tm != null) {
            tmSerial = "" + tm.getSimSerialNumber();
            deviceID = tm.getDeviceId();
        }
    }
    // Settings.Secure.ANDROID_ID + TelephonyManager.SimSerialNumber
    if (TextUtils.isEmpty(deviceID)) {
        deviceID = generateId(context, tmSerial);
    }
    return deviceID;
}
 
开发者ID:WorldBank-Transport,项目名称:RoadLab-Pro,代码行数:24,代码来源:DeviceUtil.java

示例8: getSimSerialNumber

import android.telephony.TelephonyManager; //导入方法依赖的package包/类
public static String getSimSerialNumber(Context context) {
    TelephonyManager tm = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
    if (tm == null) {
        return "";
    }
    return "" + tm.getSimSerialNumber();
}
 
开发者ID:Zyj163,项目名称:yyox,代码行数:8,代码来源:PhoneMessage.java

示例9: deviceId

import android.telephony.TelephonyManager; //导入方法依赖的package包/类
public static String deviceId(Context context) {
    final TelephonyManager tm =
            (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);

    final String tmDevice, tmSerial, androidId;
    tmDevice = "" + tm.getDeviceId();
    tmSerial = "" + tm.getSimSerialNumber();
    androidId = "" + android.provider.Settings.Secure.getString(context.getContentResolver(),
            android.provider.Settings.Secure.ANDROID_ID);

    UUID deviceUuid = new UUID(androidId.hashCode(),
            ((long) tmDevice.hashCode() << 32) | tmSerial.hashCode());
    return deviceUuid.toString();
}
 
开发者ID:shivamsingh,项目名称:lockit,代码行数:15,代码来源:DroippUtil.java

示例10: getUDID

import android.telephony.TelephonyManager; //导入方法依赖的package包/类
@SuppressLint("HardwareIds")
public static String getUDID(Activity activity) {
    if (ActivityCompat.checkSelfPermission(activity, Manifest.permission.READ_PHONE_STATE) == PackageManager.PERMISSION_GRANTED) {
        TelephonyManager tm = (TelephonyManager) activity.getSystemService(Context.TELEPHONY_SERVICE);
        String tmDevice = "" + tm.getDeviceId();
        String tmSerial = "" + tm.getSimSerialNumber();
        String androidId = "" + Settings.Secure.getString(activity.getContentResolver(), Settings.Secure.ANDROID_ID);
        UUID deviceUuid = new UUID(androidId.hashCode(), ((long) tmDevice.hashCode() << 32) | tmSerial.hashCode());

        return deviceUuid.toString();
    }
    else{
        return Settings.Secure.getString(activity.getContentResolver(), Settings.Secure.ANDROID_ID);
    }
}
 
开发者ID:afiqiqmal,项目名称:My-Android-Base-Code,代码行数:16,代码来源:DeviceUtils.java

示例11: getApplicationInfo

import android.telephony.TelephonyManager; //导入方法依赖的package包/类
private void getApplicationInfo() {

        final PackageManager pm = mContext.getPackageManager();
        try {
            final PackageInfo pi = pm.getPackageInfo(mContext.getPackageName(),
                    0);
            versionName = pi.versionName;
            versionCode = pi.versionCode;

            final ApplicationInfo ai = pm.getApplicationInfo(
                    mContext.getPackageName(), PackageManager.GET_META_DATA);
			channelName = ai.metaData.get("UMENG_CHANNEL").toString();
			channelId = STIDUtil.getChannelIdByChannelName(channelName);
            debugType = ai.metaData.get("app_debug").toString();

            if ("1".equals(debugType)) {
                // developer mode
                isDebug = true;
            } else if ("0".equals(debugType)) {
                // release mode
                isDebug = false;
            }
            LogUtils.allow = isDebug;

            appName = String.valueOf(ai.loadLabel(pm));
            LogUtils.appTagPrefix = appName;
            packageName = mContext.getPackageName();

            TelephonyManager telMgr = (TelephonyManager) mContext
                    .getSystemService(Context.TELEPHONY_SERVICE);
            imei = telMgr.getDeviceId();
            sim = telMgr.getSimSerialNumber();
        } catch (NameNotFoundException e) {
            Log.d(TAG, "met some error when get application info");
        }
    }
 
开发者ID:SavorGit,项目名称:Hotspot-master-devp,代码行数:37,代码来源:Session.java

示例12: getUDID

import android.telephony.TelephonyManager; //导入方法依赖的package包/类
@SuppressLint("HardwareIds")
public static String getUDID(Activity activity) {
    if (ActivityCompat.checkSelfPermission(activity, Manifest.permission.READ_PHONE_STATE) == PackageManager.PERMISSION_GRANTED) {
        TelephonyManager tm = (TelephonyManager) activity.getSystemService(Context.TELEPHONY_SERVICE);
        String tmDevice = "" + (tm != null ? tm.getDeviceId() : null);
        String tmSerial = "" + (tm != null ? tm.getSimSerialNumber() : null);
        String androidId = "" + Settings.Secure.getString(activity.getContentResolver(), Settings.Secure.ANDROID_ID);
        UUID deviceUuid = new UUID(androidId.hashCode(), ((long) tmDevice.hashCode() << 32) | tmSerial.hashCode());

        return deviceUuid.toString();
    }
    else{
        return Settings.Secure.getString(activity.getContentResolver(), Settings.Secure.ANDROID_ID);
    }
}
 
开发者ID:afiqiqmal,项目名称:MVP-Android,代码行数:16,代码来源:DeviceUtils.java

示例13: getDeviceUUID

import android.telephony.TelephonyManager; //导入方法依赖的package包/类
/**
 * 获取设备序列号
 *
 * @return Str
 */
public static String getDeviceUUID() {
    final TelephonyManager tm = (TelephonyManager) App.getDefault().getSystemService(Context.TELEPHONY_SERVICE);
    final String tmDevice, tmSerial, androidId;
    tmDevice = "" + tm.getDeviceId();
    tmSerial = "" + tm.getSimSerialNumber();
    androidId = "" + android.provider.Settings.Secure.getString(App.getDefault().getContentResolver(), android.provider.Settings.Secure.ANDROID_ID);
    UUID deviceUuid = new UUID(androidId.hashCode(), ((long) tmDevice.hashCode() << 32) | tmSerial.hashCode());
    String uniqueId = deviceUuid.toString();
    return uniqueId;

}
 
开发者ID:junchenChow,项目名称:exciting-app,代码行数:17,代码来源:CommonUtil.java

示例14: getUUID

import android.telephony.TelephonyManager; //导入方法依赖的package包/类
/**
 * 获取手机UUID
 */
public static String getUUID(Context context) {
    if (android.text.TextUtils.isEmpty(uuid)) {
        final TelephonyManager tm = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
        final String tmDevice, tmSerial, tmPhone, androidId;
        tmDevice = "" + tm.getDeviceId();
        tmSerial = "" + tm.getSimSerialNumber();
        androidId = "" + android.provider.Settings.Secure.getString(context.getContentResolver(), android.provider.Settings.Secure.ANDROID_ID);
        UUID deviceUuid = new UUID(androidId.hashCode(), ((long) tmDevice.hashCode() << 32) | tmSerial.hashCode());
        uuid = deviceUuid.toString();
    }
    return uuid;
}
 
开发者ID:LuoLuo0101,项目名称:JPush,代码行数:16,代码来源:DeviceUtils.java

示例15: b

import android.telephony.TelephonyManager; //导入方法依赖的package包/类
public void b(Context context) {
    String simSerialNumber;
    TelephonyManager telephonyManager = (TelephonyManager) context.getSystemService("phone");
    try {
        String deviceId = telephonyManager.getDeviceId();
        if (deviceId != null) {
            this.a = UUID.nameUUIDFromBytes(deviceId.getBytes("UTF-8")).toString();
        }
    } catch (Exception e) {
        PingppLog.a(e.getMessage());
    }
    try {
        simSerialNumber = telephonyManager.getSimSerialNumber();
        if (simSerialNumber != null) {
            this.c = UUID.nameUUIDFromBytes(simSerialNumber.getBytes("UTF-8")).toString();
        }
    } catch (Exception e2) {
        PingppLog.a(e2.getMessage());
    }
    try {
        simSerialNumber = Secure.getString(context.getContentResolver(), "android_id");
        if (!(simSerialNumber == null || "9774d56d682e549c".equals(simSerialNumber))) {
            this.b = UUID.nameUUIDFromBytes(simSerialNumber.getBytes("UTF-8")).toString();
        }
    } catch (Exception e22) {
        PingppLog.a(e22.getMessage());
    }
    try {
        simSerialNumber = Build.SERIAL;
        if (simSerialNumber != null) {
            this.d = UUID.nameUUIDFromBytes(simSerialNumber.getBytes("UTF-8")).toString();
        }
    } catch (Exception e222) {
        PingppLog.a(e222.getMessage());
    }
    PingppLog.a("deviceId: " + this.a + "\nandroidId: " + this.b + "\nsimSerialNum: " + this
            .c + "\nserialNum: " + this.d);
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:39,代码来源:l.java


注:本文中的android.telephony.TelephonyManager.getSimSerialNumber方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。