The imsi (International Mobile User ID) and IMEI (international mobile device ID) of the SIM card in the mobile phone. The imsi uniquely corresponds to the SIM card, and the IMEI corresponds to the device.
Possible application scenarios: you may need a unique ID to authorize/register, or the following two lines of code for your Android-activity license will give you a unique SIM card ID imsi and a unique device id imei.
Description:
Imsi is a unique number that identifies the only user in the GSM and UMTS networks. It is stored in the SIM card of the mobile phone and will be sent to the network through the mobile phone.
IMEI is also a unique number that identifies the only mobile phone in the GSM and UMTS networks. it is usually printed under the cell phone, dial * #06 # To See It.
TelephonyManager tm = (TelephonyManager)context.getSystemService(Context.TELEPHONY_SERVICE);String imei = tm.getDeviceId();String imsi = tm.getSubscriberId();
To execute the above Code, you need to add the permission androidmanifest. xml.
<! -- Read mobile phone information --> <uses-Permission Android: Name = "android. Permission. read_phone_state"> </uses-Permission>