Turning Scanner Off/On with intent

Hello all:

I know there was a question in 2020 about enabling/disabling the scanner on Android devices with intent and at that time it was not possible! Wanted to follow up and see if this has been added? We would like to do it with the intent so we do not need to load any SDKs! It seems that most mfgs are moving in this direction … are you guys there yet?

Thank you

Marshall

Hello @Marshall_Ellis,

Looks like you haven’t posted in awhile, welcome back.

We did add quite a few Intent Actions in our SDK 1.29, for reference we are on 1.34 now.

Check out the following section of our SDK documentation that covers exposed Intent Actions:
https://datalogic.github.io/android-sdk-docs/reference/com/datalogic/device/Intents.html#ACTION_CONFIGURATION_COMMIT

Specifically, ACTION_CONFIGURATION_COMMIT can be sent a map of properties as an extra bundle.

Check out this page that covers all the properties that can be sent:
https://datalogic.github.io/android-sdk-docs/reference/com/datalogic/device/configuration/PropertyID.html

There are a few ways to go about disabling the scanner, one would be to disable the triggers, which are part of the Keyboard Triggers Group.
Another way would be to disable the Wedges, likely only one is enabled, but you can disable all of them to be sure no data will be sent that way.
Personally, I prefer to disable the triggers, so when the user pulls the trigger nothing happens and then the user does not expect data to be read.

Drew Hugentobler
L3 Mobile Computer Specialist Support Engineer

1 Like

Drew:

I know I haven’t posted in a while … because never had a problem with your stuff :wink:
Thanks a ton for your help!
So can this be done without adding the SDK to the app?

Thank you

Marshall

Hello @Marshall_Ellis ,

yes, through the ConfigurationManager class by setting the WEDGE_KEYBOARD_ENABLE and WEDGE_INTENT_ENABLE propertyID then issuing an ACTION_CONFIGURATION_COMMIT you can turn on/off the KeyboardWedge or the IntentWedge respectively.

With KEYBOARD_RIGHT_TRIGGER, KEYBOARD_LEFT_TRIGGER, KEYBOARD_FRONT_TRIGGER, KEYBOARD_PISTOL_TRIGGER, and the optional KEYBOARD_MOTION_TRIGGER propertyID you can enable or disable the triggers.

Regards
Simone

The documentation of ACTION_CONFIGURATION_COMMIT also includes some examples:

java code example:

Intent intent = new Intent(Intents.ACTION_CONFIGURATION_COMMIT);
 HashMap map = new HashMap();
 map.put(PropertyID.WIFI_802_DOT_11_MODE, Wifi802Dot11Mode.WIFI_802_DOT_11_ABG.toString());
 map.put(PropertyID.CODE128_ENABLE, "true")
 map.put(PropertyID.CODE128_LENGTH2, "10");
 map.put(PropertyID.CODE128_USER_ID, String.format ("\\u%04x", (int)'a'));
 intent.putExtra(Intents.EXTRA_CONFIGURATION_CHANGED_MAP, map);
 mContext.sendBroadcast(intent);

ADB example with extra data as List:

adb shell am broadcast -a com.datalogic.device.intent.action.configuration.COMMIT
 --esal com.datalogic.device.intent.extra.configuration.CHANGED_MAP "TOUCH_MODE_SENSITIVITY=TOUCH_MODE_STYLUS,800=10,CODE128_ENABLE=false"

ADB example with extra data as String:

adb shell am broadcast -a com.datalogic.device.intent.action.configuration.COMMIT
 --es com.datalogic.device.intent.extra.configuration.CHANGED_MAP "TOUCH_MODE_SENSITIVITY=TOUCH_MODE_STYLUS,800=10,CODE128_ENABLE=false"

Simone Callegari
L3 Mobile Computer Specialist Support Engineer