Enumerate Scanners

DataWedge 6.3


Introduced in DataWedge 6.3.

Generates a numbered list (index) of scanners available on the device.

IMPORTANT: The scanner index is not fixed for all devices. It varies depending on the number of supported internal and/or external scanners installed and/or connected to the device at the time the index is generated.

Function Prototype

Intent i = new Intent();
i.putExtra("com.symbol.datawedge.api.ENUMERATE_SCANNERS", "");


ACTION [String]: "com.symbol.datawedge.api.ENUMERATE_SCANNERS"

Return Values

The enumerated list of scanners is returned via the broadcast intent com.symbol.datawedge.api.ACTION_ENUMERATEDSCANNERLIST. The list of scanners is returned as a string array (see example below).

Error and debug messages are logged to the Android logging system, which can be viewed and filtered by the logcat command. Use logcat from an ADB shell to view the log messages:

$ adb logcat -s DWAPI

Error messages are logged for invalid actions and parameters.


// First send the intents to enumerate the available scanners on the device:
i.putExtra("com.symbol.datawedge.api.ENUMERATE_SCANNERS", "");

// define action string:
String enumerateScanners = "com.symbol.datawedge.api.ACTION";

// create the intent:
Intent i = new Intent();

// set the action to perform:

// send the intent to DataWedge:

// enable the app to receive the enumerated list of available scanners:
String enumeratedList = "com.symbol.datawedge.api.ACTION";

// create a filter for the broadcast intent
IntentFilter filter = new IntentFilter();
    filter.addCategory(Intent.CATEGORY_DEFAULT);  // NOTE: REQUIRED for DW6.2 and higher
    registerReceiver(myBroadcastReceiver, filter);

// create a broadcast receiver
private BroadcastReceiver myBroadcastReceiver = new BroadcastReceiver() {
   public void onReceive(Context context, Intent intent) {
        String action = intent.getAction();
        Log.d(TAG, "Action: " + action); 

            Bundle b = intent.getExtras();

// enumerate scanners
if(intent.hasExtra("com.symbol.datawedge.api.RESULT_ENUMERATE_SCANNERS")) {
    ArrayList<Bundle> scannerList = (ArrayList<Bundle>) intent.getSerializableExtra("com.symbol.datawedge.api.RESULT_ENUMERATE_SCANNERS");
if((scannerList != null) && (scannerList.size() > 0)) {
    for ( Bundle bunb: scannerList)
        Log.d(TAG,"Scanner:"+bunb.getString("SCANNER_NAME")+" Connection:"+bunb.getBoolean("SCANNER_CONNECTION_STATE")+" Index:"+bunb.getInt("SCANNER_INDEX"));


The scanner and its parameters are set based on the currently active Profile.


Zebra Support Central | Integrator Guides, Product Manuals, Software Downloads and Support

LaunchPad | Zebra Developer Community

Intent | Android Developers

Intents and Intent Filters | Android Developers

Android Intents | Tutorial