'android id'에 해당되는 글 1건

  1. 2014.01.20 안드로이드 고유ID(UUID) 가져오기.
JAVA/Android2014.01.20 11:06

Android UUID 가져오기.


private String GetDevicesUUID(Context mContext) {


final TelephonyManager tm = (TelephonyManager) mContext

.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 deviceId = deviceUuid.toString();


return deviceId;

}

신고
Posted by Namseungil