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();
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.
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" />
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.
来源:https://stackoverflow.com/questions/21228525/how-to-get-imei-number-for-google-nexus-7-tab-in-android