How to get IMEI in Android Version 10 or 11?

I want get IMEI in Android 10 or 11, but i'm getting exception Like this " java.lang.SecurityException: getImeiForSlot: The user 10148 does not meet the requirements to access device identifiers."

Please help, Thanks

1 answer

  • answered 2020-03-28 10:38 Divyang Panchal

    Android Q has restricted to access for both IMEI and serial no. It is available only for platform and apps with special carrier permission. Also the permission READ_PRIVILEGED_PHONE_STATE is not available for non platform apps.

    If you try to access it throws below exception

    java.lang.SecurityException: getImeiForSlot: The user 10180 does not meet the requirements to access device identifiers.

    Please refer documentation https://developer.android.com/preview/privacy/data-identifiers#device-ids