Friday, 29 June 2012

Android Device ID (UDID)


public void getDeviceID() {

// There are three types of identifier on android phone.

// IMEI
// IMSI

String ts = Context.TELEPHONY_SERVICE;
TelephonyManager mTelephonyMgr = (TelephonyManager) getSystemService(ts);
String imsi = mTelephonyMgr.getSubscriberId();
String imei = mTelephonyMgr.getDeviceId();
// Android ID It is a 64-bit hex string which is generated on the
// device's first boot. Generally it won't changed unless is factory
// reset.

String android_id = Secure.getString(getContentResolver(),
Secure.ANDROID_ID);//This is also called UDID

}

No comments:

Post a Comment