I have many phones I need to register in a database with IMEI barcodes and install a company app on it to connect and track them. For this purpose I need to access the IMEI with getDeviceID(). Since Android 10, it is not as simple.
In this page, Android says if you are device owner you can access it : https://developer.android.com/training/articles/user-data-ids
I use this method to make my app a device owner app :
How to make my app a device owner?
adb shell dpm set-device-owner com.package.name/.MyDeviceAdminReceiver
When I use getDeviceId() in the app, I still have the error :
java.lang.SecurityException: getDeviceId: The user 10180 does not meet the requirements to access device identifiers.
Why this method doesn't work ?
Do you have any suggestions to the IMEI ?