Most applications will need to temporarily disable the barcode scanner during their lifecycle. There are two ways to achieve this with DataWedge, both using the ScannerInputPlugin API: Enable / Disable or Resume / Suspend:

Enable / Disable:

Enable / Disable can be called at any time

Intent dwIntent = new Intent();
//  Enable
dwIntent.putExtra("com.symbol.datawedge.api.SCANNER_INPUT_PLUGIN", "ENABLE_PLUGIN");
//  or Disable
dwIntent.putExtra("com.symbol.datawedge.api.SCANNER_INPUT_PLUGIN", "DISABLE_PLUGIN");

Resume / Suspend:

Resume / Suspend is much quicker but Suspend can only be called when the scanner is in the SCANNING or WAITING state

Intent dwIntent = new Intent();
//  Resume
dwIntent.putExtra("com.symbol.datawedge.api.SCANNER_INPUT_PLUGIN", "RESUME_PLUGIN");
//  or Suspend
if (okToSuspend)
    dwIntent.putExtra("com.symbol.datawedge.api.SCANNER_INPUT_PLUGIN", "SUSPEND_PLUGIN");

You can determine the scanner state using the GetScannerStatus or RegisterForNotification APIs:

//  RegisterForNotification
protected void onResume()
    IntentFilter filter = new IntentFilter();
    registerReceiver(myBroadcastReceiver, filter);

private BroadcastReceiver myBroadcastReceiver = new BroadcastReceiver() {
    public void onReceive(Context context, Intent intent) {
        String action = intent.getAction();
        if (action.equals("com.symbol.datawedge.api.NOTIFICATION_ACTION"))
            if (intent.hasExtra("com.symbol.datawedge.api.NOTIFICATION"))
                Bundle extras = intent.getBundleExtra("com.symbol.datawedge.api.NOTIFICATION");
                String notificationType = extras.getString("NOTIFICATION_TYPE");
                if (notificationType != null && notificationType.equals("SCANNER_STATUS"))
                    //  We have received a change in Scanner status
                    String scannerStatus = extras.getString("STATUS");
                    if (scannerStatus.equals("WAITING") || scannerStatus.equals("SCANNING"))
                            okToSuspend = true;
                            okToSuspend = false;

A simple project to demonstrate these API calls is available from

As can be seen from the gif below or from this demo video, it is much quicker resuming the scanner compared to enabling it.

Demo gif