How to Retrieve the Terminal's IMEI Number: Difference between revisions
m (Jeff moved page How to obtain IMEI of terminal to How to obtain IMEI of the terminal) |
No edit summary |
||
Line 3: | Line 3: | ||
(TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE); | (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE); | ||
String imei = telephonyManager.getImei(slot index); | String imei = telephonyManager.getImei(slot index); | ||
Note: in Q2 Android 12, use above code to get IMEI, targetSDK version should <=28. |
Revision as of 02:21, 24 May 2023
The code snippet is as follows:
TelephonyManager telephonyManager = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE); String imei = telephonyManager.getImei(slot index);
Note: in Q2 Android 12, use above code to get IMEI, targetSDK version should <=28.