device_id from ACTION_DEVICE_INFO

I have a question about “device_id” taken from ACTION_DEVICE_INFO (SYSTEM.Version - Datalogic SDK version 1 | Android Add-on). Can I use it as constant device Id? Is it not possible to change “device_id”? Is it unique? Is it unique for all Datalogic devices, or only for given device model or something else?

Maybe there is some way to read the serial number without being device owner app?

Hello @Bartosz_Kujawa

the device_id taken from ACTION_DEVICE_INFO is a numeric ID that identifies specific combinations of Device Models (Sx5, M20, Me10…) and ScanEngines (), and is always unique for the same Model-ScanEngine combination.

To read the device’s Serial Number (unique and invariant for each sample), since on On Android 10 only privileged apps can access the Build.getSerial() system method, with the most recent Firmware Images and the SDK 1.27, the ACTION_DEVICE_INFO returns also a new Extra named EXTRA_SERIAL_NUMBER, while the ** ** class has introduced a new “SERIAL_NUMBER” static fields which returns the same information.

From Datalogic SDK’s collection of standard examples, the DeviceSampleAPI
sample project demonstrates the output of these fields:

For a more general overview, se also the post “How to read the Serial Number on Datalogic Android Devices”.

Simone Callegari
Datalogic Mobile Products Specialist - SW Engineer