获取手机的UUID

来源:互联网 发布:javascript框架 编辑:程序博客网 时间:2024/05/17 03:06
final TelephonyManager tm = (TelephonyManager) getBaseContext().getSystemService(Context.TELEPHONY_SERVICE);    final String tmDevice, tmSerial, androidId;    tmDevice = "" + tm.getDeviceId();    tmSerial = "" + tm.getSimSerialNumber();    androidId = "" + android.provider.Settings.Secure.getString(getContentResolver(), android.provider.Settings.Secure.ANDROID_ID);    UUID deviceUuid = new UUID(androidId.hashCode(), ((long)tmDevice.hashCode() << 32) | tmSerial.hashCode());    String uniqueId = deviceUuid.toString();    info.setText(uniqueId);
0 0
原创粉丝点击