Data Capture in Java

Shows how to receive scanned barcode data, configure DataWedge, register for scanner status notifications, and use the software scan trigger via DataWedge Intent APIs.

Download Source

Product

DataWedge - 11.3

Devices

All supported Zebra Android Marshmallow (v6.0) or above devices

Overview

This sample app demonstrates how to receive scanned barcode data through an Android intent, configure DataWedge, register for scanner status notifications, and use the software scan trigger via DataWedge Intent APIs.

Available actions in this sample:

  • Display the DataWedge version
  • Create a profile if it does not exist
  • Select/deselect certain decoders for scanning
  • Toggle software scan trigger
  • Register for scanner status notifications, such as waiting, scanning, etc.
  • Display the following for each decoded barcode:
    • scan data
    • decoder type

This sample application is only intended for educational purposes, demonstrating the use of DataWedge intent API(s).

APIs Used

DataWedge API App Functionality
Get Version Info Get DataWedge version installed on device
Create Profile Check for existing profile, create if it does not exist
Set Config Set selected/deselected decoders
Register for status notifications Register to receive notifications via intent for scanner status changes
Soft Scan Trigger Control scanning via Soft Scan Trigger button

Requirements

  • This sample was created based on DataWedge version 7.0 (version that existed at the time of creation). Check DataWedge API documentation for any future version changes that may affect functionality.
  • Android API 23 (Marshmallow) or higher.
  • DataWedge (built-in all Zebra devices) is running on the device.

Using This Sample

  1. Download, build, and launch the sample app. img

  2. View the DataWedge version installed on the device. img

  3. Tap Create. “DWDataCapture1” profile is created if it does not exist and associates it with this application. img

  4. Select/deselect decoders. All other decoders not specified are set to defaults. Tap Set to save. img

  5. Press the hard trigger button or toggle the soft scan trigger button to scan. img

  6. View the displayed information:

    • Scanner status

  7. Scan decoder
  8. Scan data img

Related guides: