logo
  • TechDocs
  • DataWedge 11.0

  • About
  • Guides
  • Profiles
  • Feature Matrix
  • Decoders
  • Settings
  • APIs
  • Samples
  • FAQ
    • CN - 普通话 CN - 普通话
    • JP - 日本語 JP - 日本語
  • Enumerate Triggers
  • ENUMERATE_TRIGGERS
    • Function Prototype
    • Parameters
    • Return Values
  • Example Code

Enumerate Triggers

DataWedge 11.0

ENUMERATE_TRIGGERS

Retrieve supported trigger list of a device. Applies only when configuring multiple scanners to retrieve the name of the trigger for use with scanner_selection_by_identifier from Set_Config.

Function Prototype

Intent i = new Intent();
i.setAction("com.symbol.datawedge.api.ACTION");
i.setPackage("com.symbol.datawedge");
i.putExtra("com.symbol.datawedge.api.ENUMERATE_TRIGGERS", "");
sendBroadcast(i);

Parameters

ACTION [string]: "com.symbol.datawedge.api.ACTION"

EXTRA_DATA [string]: "com.symbol.datawedge.api.ENUMERATE_TRIGGERS"

EXTRA VALUE [string]: empty string

Return Values

Returns a string array of supported triggers.

EXTRA NAME: "com.symbol.datawedge.api.RESULT_ENUMERATE_TRIGGERS"

EXTRA TYPE: string[ ]

Example Code

Sample code to send intent to enumerate triggers:

Intent i = new Intent();
i.setAction("com.symbol.datawedge.api.ACTION");
i.setPackage("com.symbol.datawedge");
i.putExtra("com.symbol.datawedge.api.ENUMERATE_TRIGGERS", "");
sendBroadcast(i);

Sample code to retrieve the result of the array of supported triggers:

private BroadcastReceiver broadcastReceiverTriggers = new BroadcastReceiver() {
    @Override
    public void onReceive(Context context, Intent intent) {
        Bundle extras = intent.getExtras();
        if (intent.hasExtra("com.symbol.datawedge.api.RESULT_ENUMERATE_TRIGGERS")) {

            String[] triggerList = extras.
                    getStringArray("com.symbol.datawedge.api.RESULT_ENUMERATE_TRIGGERS");
            List<String> arrTriggerList = Arrays.asList(triggerList);
            String strTriggers = "Trigger List: <br>";
            for (String trigger : arrTriggerList) {
                strTriggers += trigger + "<br>";
            }
            //Log.d(TAG, strTriggers);
        }
    }
};

SEE ALSO:

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


ZEBRA and the stylized Zebra head are trademarks of Zebra Technologies Corp., registered in many jurisdictions worldwide. All other trademarks are the property of their respective owners. ©2020 Zebra Technologies Corp. and/or its affiliates.
Legal | Terms of Use | Privacy Policy