Home > DeveloperSection > Interviews > Write code snippet to retrieve IMEI number of Android phone.

Posted on    May-27-2015 2:08 AM

 Android Android 
Ratings:
 1 Answer(s)
  538  View(s)
Rate this:

Mayank Tripathi
Mayank Tripathi

Total Post:807

Points:4035
Posted on    May-27-2015 2:08 AM

TelephonyManager class can be used to get the IMEI number. It provides access to information about the telephony services on the device.
TelephonyManager mTelephonyMgr = (TelephonyManager)
        getSystemService(Context.TELEPHONY_SERVICE);
        String imei = mTelephonyMgr.getDeviceId();

Don't want to miss updates? Please click the below button!

Follow MindStick