androidandroid-intentbarcodezxinggs1-128

ZXing Barcode Scanner Intent: set DecodeHintType.ASSUME_GS1


In my app I want to scan a GS1-128 barcode, and need the FNC1 characters passed from the ZXing barcode scanner. Right now I just receive the plain text without the FNC1 characters.

Is there a way to pass the DecodeHintType.ASSUME_GS1 via Intent to the scanner app?

I don't want to include the complete scanner source in my app and rather use the Intent.

In the source code of the scanner I can see that the DecodeHintType needs to be set to achive that: https://code.google.com/p/zxing/source/browse/trunk/core/src/main/java/com/google/zxing/oned/Code128Reader.java

 boolean convertFNC1 = hints != null && hints.containsKey(DecodeHintType.ASSUME_GS1);

Thanks for any help. I searched almost the whole web and didn't find an answer to this. This is driving me nuts...


Solution

  • At the end it turned out that it was easier than I thought:

    intentScan.putExtra("ASSUME_GS1", true);
    

    The hints can be set with extras. I just had to figure it out, because I couldn't find it anywhere how to do that.

    I downloaded the code of the Barcode Scanner and did a little debugging. But now I can use the original app and get the barcode via Intent. :-)