二维码扫描
我根据帖子 直接集成 ZXing 库添加了 ZXing 的核心 jar 文件进入我的 Android 应用程序
在我的应用程序中,我试图创建一个根据帖子启动 QR 阅读器的意图 二维码扫描仪
但是我在 core.jar 中找不到 CaptureActivity 类?
如何在不使用任何外部应用程序的情况下读取应用程序中的二维码?
谢谢, 埃亚尔。
I have added core jar file of ZXing according to post Integrating the ZXing library directly into my Android application
in my application i'm trying to create an intent that starts the QR reader according to post
QR code scanner
But i can not find the CaptureActivity class in the core.jar?
How can I read QR code within my application without using any external application?
Thanks,
Eyal.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
CaptureActivity 应该在那里,只是如果您想运行它,您仍然必须将其添加到 AndroidManifest.xml 中,因为这不会从 jar 中继承。添加此 XML
参考:http://damianflannery.wordpress.com/2011/06/13/integrate-zxing-barcode-scanner-into-your-android-app-natively-using-eclipse/
(是,我自己尝试过)
也确保你有
CaptureActivity should be there, it's just that you still have to add it to AndroidManifest.xml if you want to run it because that won't carry over from the jar. Add this XML
Reference: http://damianflannery.wordpress.com/2011/06/13/integrate-zxing-barcode-scanner-into-your-android-app-natively-using-eclipse/
(Yes, I have tried this myself)
also make sure you have
您所做的一切都是正确的——除了您不应该使用CaptureActivity。未找到它,因为它不是
core/
库的一部分,而是android/
的一部分,它是我们的应用程序 Barcode Scanner 的源代码。我建议不要直接重用我们的代码,因为您必须复制大量代码才能使其正常工作,而大多数走这条路的人只是复制几乎所有内容,这是不行的。您需要编写自己的应用程序。看看
android/
中的代码如何调用DecodeHandler
中的核心库进行解码。您可以查看我们的AndroidManifest.xml
以了解如何声明您的意图。您不需要也不应该复制我们的CaptureActivity
。它的存在是为了好的想法,而不是克隆。You're doing everything right -- except that you should not be using
CaptureActivity
. It's not found since it's not part of thecore/
library, but rather part ofandroid/
, which is the source for our app, Barcode Scanner. I'd suggest not reusing our code quite that directly, since you will have to copy a lot to get it to work, and most people who go this route just copy nearly everything, and that's not OK.You need to write your own application. See how the code in
android/
calls the core library for decoding inDecodeHandler
. You can look at ourAndroidManifest.xml
to see how to declare your intents. You do not need to, and should not, copy ourCaptureActivity
. It's there for good ideas, not cloning.