ZXing酒吧code扫描仪意图:建立德codeHintType.ASSUME_GS1 [英] ZXing Barcode Scanner Intent: set DecodeHintType.ASSUME_GS1

查看:309
本文介绍了ZXing酒吧code扫描仪意图:建立德codeHintType.ASSUME_GS1的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的应用我想扫描GS1-128酒吧code,并且需要从斑马线条code扫描仪通过FNC1字符。
现在我刚刚收到的纯文本没有FNC1字符。

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.

有没有办法通过意图传递德codeHintType.ASSUME_GS1到扫描仪的应用程序?

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.

在扫描仪的光源$ C ​​$ C我可以看到德codeHintType需要设置才达到的:
<一href=\"https://$c$c.google.com/p/zxing/source/browse/trunk/core/src/main/java/com/google/zxing/oned/$c$c128Reader.java\" rel=\"nofollow\">https://$c$c.google.com/p/zxing/source/browse/trunk/core/src/main/java/com/google/zxing/oned/$c$c128Reader.java

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...

推荐答案

在最后事实证明,它比我想象的容易:

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.

我下载了酒吧code扫描仪的code和做了一些调试。
但现在我可以使用原来的应用程序,并通过意向获得了吧code。 : - )

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. :-)

这篇关于ZXing酒吧code扫描仪意图:建立德codeHintType.ASSUME_GS1的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆