Library meant to simplify the usage of DataWedge across Zebra devices by using a method oriented approach to setup different aspects of a profile instead of working with multiple nested bunldes which could get messy.
The way this library works is very simple, it is based on builders meaning that you can create and apply configurations for a specific profile just by using methods instead of working with complicated nested bundles.
We simplify as much as possible the interface for you and we take care of the rest. It will provide an easier and flexible way of working with DataWedge and also save a good amount of lines of code.
This requires that you already know how DataWedge works on the Zebra devices. If you don't know anything about it please visit the official documentation on TechDocs here and get familiar with it.
Top level build.gradle
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
mavenCentral()
maven { url 'https://jitpack.io' }
}
}
Module level build.gradle
dependencies {
implementation "com.github.nilac8991:datawedge-configurator:2.0.0"
}
Warning
Please be aware that this library is NOT officially supported by Zebra and it is distributed as is without any guarantee of "eternal" support or updates. I'll do my best to keep it updated as long as I can, so if you plan to use it inside your project remember that this is your choice and you understand the risks.
DataWedge is very big in terms on how many features and parameters it offers, which is also why it took quite some time to map everything into this library.
You will find available most of the features that developers typically use when working traditionally with DataWedge on Zebra devices.
Plugin | Status | Notes |
---|---|---|
Barcode | - NextGen SimulScan Parameters are not supported - UDI Parameters are not supported - OCR Parameters are not supported - Option to enable/disable symbologies is supported but there's no current support to personalise params of a specific symbology |
|
Magnetic Stripe Reader (MSR) | ||
RFID | Planned to be added soon | |
SERIAL | ||
VOICE | ||
WORKFLOW | ||
Basic Data Formatting (BDF) | ||
Advanced Data Formatting (ADF) | Not planned to be added anytime soon | |
TOKENS | Not planned to be added anytime soon | |
INTENT | ||
KEYSTROKE | ||
IP | ||
Data Capture Plus (DCP) | ||
Enterprise Keyboard (EKB) |
- Create new profiles
- Associate applications/activities to a profile
- Disable/Enable the scanner
- Listen for incoming data/responses from DataWedge via Listeners
Note
Not all the features that DataWedge provides are covered by the library so if you're looking for something in specific, feel free to reach out by writing me an email.
Working with the library is very simple, if you had previous experience with DataWedge, you will notice that the methods are following almost everytime the names associated with the original parameters. At the same time whenever you're planning to work on a specific category of settings such as Barcode Input, you will then have to use the BarcodePlugin from the library and same goes also for other plugins such as IntentOutput, Keystroke and others...
DataWedgeWrapper.registerScanReceiver(this, "YourIntentAction",
object : OnScanIntentListener {
override fun onScanEvent(intent: Intent) {
//...
}
})
//
DataWedgeWrapper.unregisterScanReceiver(this)
Sending data and listening for last result
DataWedgeWrapper.sendIntentWithLastResult(
this, Constants.IntentType.SET_CONFIG,
mainBundle, CommandIdentifier.SET_CONFIG
) { wasSuccessful, resultInfo, resultString, command, profileName ->
//...
}
Sending data and listening for complete result
DataWedgeWrapper.sendIntentWithCompleteResult(
this, Constants.IntentType.SET_CONFIG,
mainBundle, CommandIdentifier.SET_CONFIG
) { resultInfo, resultString, command, profileName ->
//...
}
Sending data without listening for any result
DataWedgeWrapper.sendIntent(this, Constants.IntentType.SET_CONFIG, mainBundle)
//Disable
ScannerConfigurator.disableScanner(this)
//Suspend
ScannerConfigurator.suspendScanner(this)
//Enable
ScannerConfigurator.enableScanner(this)
//Resume
ScannerConfigurator.resumeScanner(this)
val barcodePlugin = BarcodePlugin.Builder()
.setEnabled(true)
.create()
val configuratorObj = ProfileConfigurator.Builder()
.setProfileName("TestProfile")
.setProfileEnabled(true)
.addAppAssociation(
"com.example",
"com.example.MainActivity"
)
.addPlugin(barcodePlugin)
.setConfigMode(ConfigMode.CREATE_IF_NOT_EXIST)
.create()
DataWedgeWrapper.sendIntent(this, Constants.IntentType.SET_CONFIG, configuratorObj)
val barcodePlugin = BarcodePlugin.Builder()
.setEnabled(true)
.create()
val intentPlugin = IntentOutputPlugin.Builder()
.setIntentAction("com.jamesswinton.datawedgewrapper.TEST")
.setIntentOutputDelivery(IntentOutputDelivery.BROADCAST)
.setEnabled(true)
.create()
val keystrokeOutputPlugin = KeystrokeOutputPlugin.Builder()
.setEnabled(false)
.create()
val configuratorObj = ProfileConfigurator.Builder()
.setProfileName("TestProfile")
.setProfileEnabled(true)
.addAppAssociation(
"com.example",
"com.example.MainActivity"
)
.addPlugin(barcodePlugin)
.addPlugin(intentPlugin)
.addPlugin(keystrokeOutputPlugin)
.setConfigMode(ConfigMode.CREATE_IF_NOT_EXIST)
.create()
DataWedgeWrapper.sendIntent(this, Constants.IntentType.SET_CONFIG, configuratorObj)
val barcodePlugin = BarcodePlugin.Builder()
.enableSymbologies(
arrayOf(
BarcodeSymbology.UPC_A,
BarcodeSymbology.EAN_13,
BarcodeSymbology.EAN_8,
BarcodeSymbology.DATAMATRIX
)
)
.create()
// Create Main Bundle
val configuratorObj = ProfileConfigurator.Builder()
.setProfileName("TestProfile")
.addPlugin(barcodePlugin)
.setConfigMode(ConfigMode.OVERWRITE)
.create()
DataWedgeWrapper.sendIntent(this, Constants.IntentType.SET_CONFIG, configuratorObj)
- James Swinton-Bland
- Daniel Neamtu