How to Retrieve the Terminal's IMEI Number: Difference between revisions
m (Simon moved page How to obtain IMEI of the terminal to How to Retrieve the Terminal's IMEI Number: Normalize the title) |
No edit summary |
||
Line 2: | Line 2: | ||
=== Code Snippet for IMEI Retrieval === | === Code Snippet for IMEI Retrieval === | ||
Below is the code snippet necessary for retrieving the IMEI number: | Below is the code snippet necessary for retrieving the IMEI number: | ||
<syntaxhighlight lang="java"> | |||
TelephonyManager telephonyManager = | TelephonyManager telephonyManager = | ||
(TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE); | (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE); | ||
String imei = telephonyManager.getImei(slot index); | String imei = telephonyManager.getImei(slot index); | ||
</syntaxhighlight > | |||
=== Important Note for Q2 Devices with Android 12 === | === Important Note for Q2 Devices with Android 12 === | ||
When using this method on Q2 devices that operate on Android 12, it is important to note that the targetSDK version should be 28 or lower. This requirement is specific to Q2 devices with Android 12 and may not apply to other models or operating system versions. | When using this method on Q2 devices that operate on Android 12, it is important to note that the targetSDK version should be 28 or lower. This requirement is specific to Q2 devices with Android 12 and may not apply to other models or operating system versions. |
Revision as of 20:12, 5 January 2024
This guide outlines the process for obtaining the IMEI (International Mobile Equipment Identity) number of your terminal using a specific code snippet.
Code Snippet for IMEI Retrieval
Below is the code snippet necessary for retrieving the IMEI number:
TelephonyManager telephonyManager =
(TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
String imei = telephonyManager.getImei(slot index);
Important Note for Q2 Devices with Android 12
When using this method on Q2 devices that operate on Android 12, it is important to note that the targetSDK version should be 28 or lower. This requirement is specific to Q2 devices with Android 12 and may not apply to other models or operating system versions.