Interface with Device Scanner on Android Devices Through DataWedge
Zebra’s series of developer conferences for 2019 has recently concluded with our AppForum event in Las Vegas. During the year we also visited Warsaw, Sydney and Beijing and it was great to meet so many of our developers and discuss ideas, solutions and use cases. One consistent theme across all 4 events was the proliferation of DataWedge as the recommended way of interfacing with the device scanner on our Android devices so I thought it made sense to summarize the content for those who could not make it to AppForum or who were not able to attend the DataWedge sessions at the event.
Getting Started with the Developer SDKs / Develop a DataWedge Application
We ran a couple of sessions aimed at beginners who wanted to understand what DataWedge was, why you might use it and how you integrate DataWedge capabilities into your application.
We have a Getting Started guide on our techdocs portal which takes you through what DataWedge is, the profile model, how to extract data from DataWedge and the programming interface.
Simple sample apps are also available as part of the getting started experience, a very basic introduction to Intent-based scanning as well as a more featured example demonstrating basic data capture and decoder configuration via the Intent API.
Advanced Features of DataWedge for Barcode Scanning
DataWedge is significantly more capable than it first appears and so we ran a more advanced session for existing DataWedge users to ensure they were getting the most out of the tool.
The Voice Input Plugin is a new feature we introduced to allow for speech-to-text input. There is a user guide for voice input as well as a dedicated set of parameters in the SET_CONFIG API and we are continuing to make enhancements here. There is often no substitute for seeing the feature in action so I also put together an unofficial sample app to show the capabilities of Voice Input, available on github.
The ability to simultaneously scan multiple barcodes with a single trigger pull is available today for free and look out for new functionality here in future releases also. Today, we have the ability to scan up to 10 barcodes with a single trigger pull and I wrote a sample application to demonstrate this capability and receiving data via both Intent and keystroke: you can find this unofficial sample app on github.
Other topics covered as part of the ‘Advanced Features of DataWedge’ talk were:
- The DataCapture Plus plugin
- Advanced data formatting
- Multiple applications sharing a single scanner (Github example app)
- AimType settings and PickList mode
- Decode screen notification and haptic feedback
The Power of DataWedge Intent APIs
DataWedge is fully configurable via its Intent API interface which is documented on TechDocs but often nothing can substitute for a sample app. We have a couple of official samples that show use of the DataWedge API: the DataWedge API Exerciser is useful if you want to see a specific API in action and the previously mentioned Data Capture app shows how you could use some of the APIs to configure a profile and enable decoders.
The official samples are more than adequate for most users but I wanted to show as many APIs as I could within a more realistic setting. I settled on two applications: one, ‘configuration’, which demonstrates the APIs to configure DataWedge for example creating profiles and setting profile configuration and another app, ‘capture data’, which shows runtime configuration APIs e.g. switching scanner parameters or invoking a soft scan.
The two unofficial applications are designed to be run together as the ‘configuration’ app will create the profiles used by the ‘capture data’ app and both are available on github.
Configuration app:
Demonstrates the following APIs:
- Enable / Disable DW
- Get Disabled Apps
- Create Profile
- Clone Profile
- Restore (Reset DW). Be aware this will delete all your current profiles!
- Get Profiles List
- Get Version
- Get DataWedge Status
- Rename Profile
- Set Config
- Enumerate Scanners
- Retrieve the status or result of the last API call
Data Capture:
Demonstrates the following APIs:
- Get Scanner Status
- Register / Unregister for Notification
- Basic Data Formatti9ng
- Switch Scanner Params
- Switch Scanner
- Set Input Plugin (Enable / Disable Scanning)
- Get Config
- Get Active Profile
- Soft Scan Trigger
In Conclusion
Everything you can do with the native SDK (EMDK) can also be done with the DataWedge API. In future new functionality may appear in DataWedge before being included in the EMDK which, along with its power and ease of use, is the reason why DataWedge is the recommended approach for adding data capture capabilities into your Android application.
I spoke with many attendees of the 2019 AppForum series who provided some good feedback on DataWedge (much of it positive) but if you have any additional feedback please feel free to leave a comment on this post.
Darryn Campbell