Retrieving IMEI no. and mobile number in Android

IMEI (International Mobile Station Equipment Identity) is a unique 15 digit identification number present for every mobile (phone) device. In android applications it can be used to uniquely identify a device for some functionality required by application. For retrieving IMEI no. of a device you may use following android code:

Add this permission to AndroidManifest.xml:

And use this java code wherever you want to retrieve IMEI no.:

Also to retrieve the mobile no. of a device you may directly use following code:

But this depends on the way the number is encoded on SIM card.This returns the same as in Settings “about phone”. This may be null if unknown.

 

Sharing is caring!

Leave a Reply

Your email address will not be published. Required fields are marked *