DataWedge
103
Parameters
action: String "com.symbol.datawedge.api.ACTION_SCANNERINPUTPLUGIN"
extra_data: String "com.symbol.datawedge.api.EXTRA_PARAMETER"
<parameter>: The parameter as a string, using either of the following:
• "ENABLE_PLUGIN" - enables the plug-in
• "DISABLE_PLUGIN" - disables the plug-in
Return Values
None.
Error and debug messages will be logged to the Android logging system which then can be viewed and filtered
by the logcat command. You can use logcat from an ADB shell to view the log messages, for example:
Error messages will be logged for invalid actions and parameters.
Example
Comments
This Data Capture API intent allows the scanner plug-in for the current Profile to be enabled or disabled. For
example, activity A launches and uses the Data Capture API intent to switch to ProfileA in which the scanner
plug-in is enabled, then at some point it uses the Data Capture API to disable the scanner plug-in. Activity B is
launched. In DataWedge, ProfileB is associated with activity B. DataWedge switches to ProfileB. When activity
A comes back to the foreground, in the
onResume method, activity A needs to use the Data Capture API intent
to switch back to ProfileA, then use the Data Capture API intent again to disable the scanner plug-in, to return
back to the state it was in.
$ adb logcat -s DWAPI
// define action and data strings
String scannerInputPlugin = "com.symbol.datawedge.api.ACTION_SCANNERINPUTPLUGIN";
String extraData = "com.symbol.datawedge.api.EXTRA_PARAMETER";
public void onResume() {
// create the intent
Intent i = new Intent();
// set the action to perform
i.setAction(scannerInputPlugin);
// add additional info
i.putExtra(extraData, "DISABLE_PLUGIN");
// send the intent to DataWedge
context.this.sendBroadcast(i);
}