Android RFID Reader SDK not using androidx

E Erik Eelde 1 year 1 month ago
238 0 0

We use the rfid sdk for android and are somewhat suffering from bits of it not adhering with current best practices.

https://www.zebra.com/us/en/support-downloads/software/developer-tools/rfid-sdk-for-android.html

We use version 2.0.2.116 of the library. 

1. Using support library components

The library relies on the old LocalBroadcastManager (android.support.v4.content.LocalBroadcastManager). There is a replacement to make use of https://developer.android.com/reference/androidx/localbroadcastmanager/content/LocalBroadcastManager. It should be a drop in replacement to the old support libary version.

Any app having a single library using the old support libraries forces them to keep the jetifier enabled: https://developer.android.com/tools/jetifier. The jetifier results in vastly longer build times. https://adambennett.dev/2020/08/disabling-jetifier/ reports performance wins of 40% by disabling the jetifier.

 

2. Violating security safeguards on android 14.

We want our app to not only work on zebra devices (although that is our primary use case) and on the latest API version (14) the app crashes during launch: 

One of RECEIVER_EXPORTED or RECEIVER_NOT_EXPORTED should be specified when a receiver isn't being registered exclusively for system broadcasts

Relevant stacktrace: 

at android.content.ContextWrapper.registerReceiver(ContextWrapper.java:755)
at com.zebra.rfid.api3.Readers.a(Unknown Source:26)
at com.zebra.rfid.api3.Readers.<init>(Unknown Source:20)

The required missing implementation can be found here: 

https://developer.android.com/guide/components/broadcasts#context-registered-receivers

 

CONTACT
Can’t find what you’re looking for?