Basic Intent in Java

Shows how to receive scanned barcode data through an Android intent.

Download Source

Product

DataWedge - 11.0

Devices

All supported Zebra Android devices

Overview

This sample demonstrates how to use DataWedge to receive scanned barcode data through an Android intent.

Available actions in this sample:

  • Display the following for each decoded barcode:
    • scan source
    • 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
None None

Requirements

  • DataWedge (built-in all Zebra devices) is running on the device.
  • DataWedge profile created and associated with this sample app. See instructions below.

Configuration

Configure DataWedge to output scans via intent:

  1. Launch DataWedge via Apps > DataWedge.

  2. Select a profile (e.g. Profile0 which is used for all apps not explicitly assigned a profile), or create a new profile.

  3. Associate the profile with this sample app:
         a. Tap Associated Apps.
         b. In the top right menu, select New app/activity.
         c. Select com.zebra.basicintent1.
         d. Select *.

  4. Confirm the following settings:

    • The profile is enabled
    • Barcode input is enabled
    • Intent output is enabled
  5. Configure the intent output as follows:

    • Intent action: com.dwbasicintent1.ACTION (to match value defined in the strings.xml file)
    • Intent category: (leave blank)
    • Intent delivery: Broadcast intent

Using This Sample

To use the app:

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

  2. Scan a barcode. The data fields are populated. img


Related guides: