Android SDK - Null Pointer Exception by setting regulatory config

// Expert user has replied.
A Andrey Sedelnikov 2 years 8 months ago
195 2 0

HI,

I am trying to connect to MC3300 reader using Android SDK (2.0.1.44). First connection fails because of "not configured region".
Ok, I set region exactly with the code snippet as recommended here:
https://techdocs.zebra.com/dcs/rfid/android/2-15/guide/regulatory/

But I get the exception as below on the last line.
What am I missing?

Regards

java.lang.NullPointerException: Attempt to get length of null array
at com.zebra.rfid.api3.l1.b(Unknown Source:95)
at com.zebra.rfid.api3.l.b(Unknown Source:2)
at com.zebra.rfid.api3.k.b(Unknown Source:0)
at com.zebra.rfid.api3.o.b(Unknown Source:2)
at com.zebra.rfid.api3.Config.setRegulatoryConfig(Unknown Source:4)

Please Register or Login to post a reply

2 Replies

A Andrey Sedelnikov

After some empirical testing, I have figured out that regionInfo.getSupportedChannels() returns the null instead of array, which is what causes SDK to fail.

Ok, I am overriding the list and passing the empty array to the enabled channels:

regulatoryConfig.setEnabledChannels(new String[0]);

But the reconnect attempt fails at the same message:

OperationFailureException Command Not Allowed- Region Not Set

J James Swinton-Bland

Hi,

I think you'll need to use the 

regulatoryConfig.setRegion(regionInfo.getRegionCode()); 

API first, before trying to set the enabled channels - see here for more info: https://techdocs.zebra.com/dcs/rfid/android/2-15/guide/regulatory/

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