To find IMEI no of your Android Device, programatically




To test the  IMEI no of your Android device:

TelephonyManager telephonyManager = (TelephonyManager)getSystemService(Context.TELEPHONY_SERVICE);
        String deviceID =telephonyManager.getDeviceId();
Add below permission in the manifest file.

<uses-permission android:name="android.permission.READ_PHONE_STATE"/>

9 comments:

  1. For Dual sim how it is possible to get 2 IMEI's?

    ReplyDelete
  2. IMEI number is refers to the actual phone device not the SIM card. the SIM card is just the "subscriber id module" you can switch SIM carsd but the IMEI number i still the same, baecause the device is still the same.

    ReplyDelete
  3. How i can locate an android device using IMEI number programmatically ?

    ReplyDelete
    Replies
    1. Akash,

      You may have to use Android location manager APIs + A server which can store the location data sent by devices.
      1. Get device's current location.
      2. Fetch the IMEI of the device[As posted above].
      3. Establish connection with the server and post these data in corresponding format.

      Here is the starting point for Android location manager: http://developer.android.com/training/basics/location/locationmanager.html

      Delete
  4. Btw... there are devices having multiple IMEIs. And it does give a lot of problem for identifying the device.

    ReplyDelete
  5. How to returns the EUIMID from the SIM card

    ReplyDelete
  6. How can i check whether dual sim or single???

    ReplyDelete