[ODK Table] - Device Id

Hi,

I have a custom application on ODK Table. A call to odkCommonIf.getProperty("deviceid") on older Android returns Phone’s IMEI number, but on Android 10 it returns a string of hex characters.

I could not find detailed description of device id in the ODK documentation. When does it return IMEI number? When does it NOT return IMEI number (because of android’s security policy)?

Hi @Thien_Mai!

I don’t think there is an equivalent to deviceid, see:

We generally track users in the field rather than devices to achieve a similar goal.
This is however an item that other folks have mentioned before, so if you want to add it to the features here on the Forum or raise an issue on github that will be helpful!

Hi @Thien_Mai,

It looks like this is an Android 10 restriction rather than an ODK-X issue:

Starting in Android 10, apps must have the READ_PRIVILEGED_PHONE_STATE privileged permission in order to access the device’s non-resettable identifiers, which include both IMEI and serial number.

1 Like