Get Android Device ID

Device Id is number to identify your devices uniquely.For example, the IMEI for GSM and the MEID or ESN for CDMA phones.It helps developer to do various functionality.Like, Device unique ID can be used , at tracking apps installation, at generating drm for copy protection.
Variety of ways to retrieve device id in Android.
Given below are the different types of identifying devices ID in android devices.
  • Unique number (IMEI, MEID, ESN, IMSI)
  • MAC Address
  • Serial Number
  • ANDROID_ID
The IMEI, MEID, ESN, IMSI can be defined as follows:
  • IMEI( International Mobile Equipment Identity )
The unique number to identify GSM, WCDMA mobile phones as well as some satellite phones
  • MEID(Mobile Equipment IDentifier)
The globally unique number identifying a physical piece of CDMA mobile station equipment, the MEID was created to replace ESNs(Electronic Serial Number)
  • ESN(Electronic Serial Number)
The unique number to identify CDMA mobile phones
  • IMSI(International Mobile Subscriber Identity)
The unique identification associated with all GSM and UMTS network mobile phone users
To get the device Id, you can use TelephonyManager object by returning a corresponding system service(TELEPHONY_SERVICE) to it.

 TelephonyManager tm = (TelephonyManager) context  
                     .getSystemService(Context.TELEPHONY_SERVICE);  
 deviceId = tm.getDeviceId();  

Can see more way to get Device Id from Samsung Developer site.