How to Retrieve the Terminal's IMEI Number

From wizarPOS
Revision as of 02:21, 24 May 2023 by Mahong (talk | contribs)

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.