androidandroid-studiokotlintelephonymanager

How get IMEI of device?


I a beginner in android development and I try to get device IMEI but I have a problem of permission.

I don't have android.permission.READ_PRIVILEGED_PHONE_STATE property in my project but the function getImei() of TelephonyManger.java require this permission.

How can I resolve this? I am a little lost.


Solution

  • The answer is sad. We can't !

    Like @Nitsh said, "The READ_PRIVILEGED_PHONE_STATE permission is only granted to apps signed with the platform key and privileged system apps".