3

I used the below code to get IMEI number for Google Nexus 7 tab. I couldn't got. How can i get IMEI number for Google Nexus 7?

TelephonyManager telephonyManager = (TelephonyManager) context
                .getSystemService(Context.TELEPHONY_SERVICE);
        return telephonyManager.getDeviceId();
user2477865
  • 271
  • 1
  • 3
  • 12

3 Answers3

8

If I am not wrong google nexus 7 doesn't have any sim. SO if there is no sim you cannot get the IMEI number of the device as the IMEI is the network dependant on gsm networks. So if the device is wifi only you cannot identify the device by IMEI. You can use MAC address instead.

stinepike
  • 54,068
  • 14
  • 92
  • 112
  • 1
    I beg to differ, IMEI is accessible even when you don't have a SIM card. – Mario Stoilov Jan 20 '14 at 07:42
  • @MarioStoilov , IMHO it will return null if there is no sim. Definitely i can be wrong for lack of knowledge regarding this. So can you please clarify me. Thanks :) – stinepike Jan 20 '14 at 07:43
  • 1
    @StinePike if it were dependant on your SIM card, then every time you change your SIM the IMEI would change too, right? Well try it, it won't change (otherwise it wouldn't be printed on the phone/tablet's box...). Also try pulling out your sim and checking your IMEI, you'll still be able to see it. – Mario Stoilov Jan 20 '14 at 07:46
  • 5
    Just did some googling, Google Nexus 7 TAB does not use IMEI, it uses CSSN... so I guess @StinePike is right here(no sim **slot** =no IMEI). – Mario Stoilov Jan 20 '14 at 07:52
  • 2
    IMEI=International Mobile Equiment Identifier, is linked to the device. IMSI=International Mobile Subscriber Identity, is linked to the SIM. – Laurent Doré Mar 23 '15 at 09:19
  • If there is two sim card than two IMEI number :) – MilapTank Apr 16 '15 at 12:49
2

Remember, you need to add the following permission to your manifest in order to call getDeviceId();

<uses-permission android:name="android.permission.READ_PHONE_STATE" />
ardevd
  • 3,329
  • 5
  • 30
  • 55
0

From what I can tell IMEI numbers are required for, but not limited to, devices with GSM. So technically each sim slot should have a IMEI number.

But even some devices with GSM do not have an IMEI number. These devices could be illegal, There are also rumors that special agencies of governments around the world use IMEI-less devices to avoid being traced by counter-intelligence.

IMEI numbers are verified with the Luhn formula just like credit card numbers. The number consists of 3 parts,


Type Allocation Code: Indicates the modal of the device. (8 digits)

Serial number: Uniquely identifying a unit of this device. (6 digits)

Check Digit: Used to verify the IMEI number. (1 digit)


On many devices the IMEI number can be retrieved by entering *#06#. The IMEI number of a GSM device can be retrieved by sending the command AT+CGSN through data cable.

string.Empty
  • 10,393
  • 4
  • 39
  • 67