get the device id (IMEI) [ 887 views ]
Goal: get the unique device identifier
TelephonyManager tm = (TelephonyManager)getSystemService(Context.TELEPHONY_SERVICE); String device_id = tm.getDeviceId();
This is the IMEI/MEID number. We need permission to read this information.
<uses-permission android:name="android.permission.READ_PHONE_STATE"/>