Memor 10 turn on/off scanner by broadcast intent


Is there a way to turn on and off the scanner by sending a broadcast intent?
I mean something like:
val intent = Intent()
intent.action = “com.datalogic.some_api”
intent.putExtra(“some_parameter”, “disable_scanner”)

Welcome on this forum,

unfortunately at the moment a broadcast intent that enables/disables the scanner is not available.

As suggestion you can develop a receiver (documentation here) that through an explicit intent can enable/disable the scanner with this code (reference here) :

import com.datalogic.device.input.KeyboardManager;
import com.datalogic.device.input.Trigger;


KeyboardManager keyManager = new KeyboardManager();
for (Trigger trigger : keyManager.getAvailableTriggers()) {
    boolean result =  trigger.setEnabled(false); 

        //operation done
        //do something in case of failure

if you need more information on this topic please contact our technical support:

Best Regards

1 Like