Audience

There are a few sample apps and guides floating around detailing how to retrieve device identifiers on Zebra devices running Android 10 and it is a common area we get questions about so, I thought it made sense to bring everything together in a single place.

Briefly, Android 10 limits access to device identifiers for all apps running on the platform regardless of their target API level, as explained in the docs for Android 10 privacy changes.  This includes the serial number, IMEI, Bluetooth MAC and some other identifiable information.

Zebra mobile computers expose a mechanism to bypass these restrictions on device identifiers by providing the information through a separate mechanism, “OEM Info”.  Initially the device serial number and IMEI were supported with the BT MAC address being added in a subsequent LifeGuard update.  For clarity, the existing Android APIs (for Build.getSerial() for example) have not been modified and continue with their standard Android behaviour, which is to not return device information on Android 10.

The “OEM Info” mechanism exposes device identifiers via a content provider and is documented on TechDocsThere is an additional step before device identifiers can be accessed however which is to grant permission to the application to access OEM Info.

So, obtaining device identifiers on Zebra devices running Android 10 is a 2-step process:

  1. Grant permission to the application for each identifer it needs to access.
  2. Access the device identifiers via content providers exposed by OEM Info.

You are able to grant permission to the application in a number of ways, either the administrator will grant access (e.g. via StageNow or EMM) or you are able to grant access within the app itself using the EMDK profile manager.

The following shows the sample apps & documentation available:

---

Official documentation: https://techdocs.zebra.com/oeminfo/consume/

---

Sample 1:

Name: Device Identifiers Wrapper

Recommended for: Developers who just want to access the device identifiers without worrying about anything else

Github link: https://github.com/ZebraDevs/DeviceIdentifiersWrapper-Sample

Author: Laurent Trudu

Documentation: https://github.com/ZebraDevs/DeviceIdentifiersWrapper-Sample/blob/master/README.md

Description: App will grant itself permission.  Wraps all the permission and content provider logic into a simple to use wrapper object so the interface your application calls is very simple.

 

---

Sample 2:

Name: Device Identifiers Sample

Recommended for: Developers who need to understand the permission model in a bit more detail.

Github link: https://github.com/darryncampbell/EMDK-DeviceIdentifiers-Sample

Author: Darryn Campbell

Associated portal post: https://developer.zebra.com/blog/access-serial-number-and-imei-mobile-computers-running-android-10

Description: App must be granted permission by the administrator, e.g. through StageNow.  Displays device serial number and IMEI obtained through Content provider.

---

Sample 3:

Name: OEM Identifiers Sample

Github link: https://github.com/ZebraDevs/OEMIdentifiers-Java-Sample

Recommended for: Developers who want to output the device identifiers to a file for consumption elsewhere.

Author: James Swinton-Bland

Associated portal post: https://developer.zebra.com/blog/granting-permission-access-serial-imei-numbers-mobile-computers-running-a10

Description: App will grant itself permission.  Writes the device serial number and IMEI to an .ini file.

Sample 4:

Name: OEM Identifiers Sample Xamarin

Github linkhttps://github.com/darryncampbell/OEMInfo-DeviceIdentifiers-Sample-Xamarin 

Recommended for: Xamarin Developers who just want to access the device identifiers without worrying about anything else.

Author: Darryn Campbell

Description: App exposes buttons to grant itself permission and retrieve the device identifiers.