How to use Datalogic Intents to star/stop the Scan Engine

In the Datalogic devices you have the possibility to start/stop the scan engine through an intent, without importing the SDK in the application (documentation):

  • Star Scan Engine (ACTION_START_DECODE) :

       import android.content.Intent;
       ...
        Intent myintent = new Intent();
        myintent.setAction("com.datalogic.decode.action.START_DECODE");
        this.sendBroadcast(myintent);
    
  • Stop Scan Engine (ACTION_STOP_DECODE):

      import android.content.Intent;
       ...
       Intent myintent = new Intent();
       myintent.setAction("com.datalogic.decode.action.STOP_DECODE");
       this.sendBroadcast(myintent);
1 Like

These Intents can be tested from the command line, through the following ADB shell commands:

  • Star Scan Engine (ACTION_START_DECODE) :

    adb shell am broadcast -a com.datalogic.decode.action.START_DECODE

  • Stop Scan Engine (ACTION_STOP_DECODE):

    adb shell am broadcast -a com.datalogic.decode.action.STOP_DECODE

1 Like