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.
2
Answers
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".try use below code in kotlin.
this link would be helpful.
How to get the device's IMEI/ESN programmatically in android?