androidkotlindatawedgezebra-scanners

Zebra DataWedge Intents with GS-128


I am beginning to develop an Android app for a Zebra MC9300 scanner and running into what I'm guessing is a configuration issue, but being new to both Zebra and Android development, I'm at a bit of a loss.

I started out using the samples from https://github.com/darryncampbell/DataWedge-GettingStarted-Samples and the Kotlin code for handling the Intent seems to be this block:

private fun displayScanResult(scanIntent: Intent) {
        val decodedSource =
            scanIntent.getStringExtra(resources.getString(R.string.datawedge_intent_key_source))
        val decodedData =
            scanIntent.getStringExtra(resources.getString(R.string.datawedge_intent_key_data))
        val decodedLabelType =
            scanIntent.getStringExtra(resources.getString(R.string.datawedge_intent_key_label_type))
        val scan = "$decodedData [$decodedLabelType]\n\n"
        val output = findViewById<TextView>(R.id.txtOutput)
        output.text = scan + output.text
    }

This seems to output what's scanned as raw text within this app, but the problem I'm having seems to be centered around a non-printing character that's in here. Using an actual barcode (DATAMTRIX) we would need to scan, the output on the screen was this:

01208126080300201726
073110W21H171[X]3024

[X] here is the non-printing character that seems to show up. Through various searches I was able to stumble on this, but it didn't seem to do anything for me: https://supportcommunity.zebra.com/s/article/DataWedge-Android-Search-and-Remove-Group-Separator?language=en_US. The end goal (preferably via intents) would be to receive the above as something like this:

01: 20812608030020
17: 260731
10: W21H171
30: 24

Based on conversations with my sales rep, DataWedge should allow me to do this, but even using Keyboard output, the best I can get out of it is the values for 17 and 10 - that non-printing character before 30 (for quantity) seems to break it because it won't show up on either this sample app or DWDemo, which is pre-installed on the scanner.

Can anyone point me in the right direction for intents with Zebra/DataWedge and having it parse out all elements that are scanned and breaking them up like the above? If intents can't do this (since DataWedge is supposed to handle auto-parsing for me), I'm not opposed to keyboard output, but right now it can't seem to give me that quantity field.

Thanks!


Solution

  • After going back and forth with our sales rep and one of their engineers, it turns out the reason this wasn't working is because of a bug within Zebra's DataWedge platform - it's supposed to automatically do what we're after above, but because of that bug it wasn't.