如何在Android中使用ZXing
我是 Zxing 的新手。我正在我的 Android 应用程序中使用 zxing 进行条形码转换。谁能指导我如何将 zxing 包含到 Android 设备中。
I am new to Zxing. I am doing barcode conversion using zxing in my android application. Can anyone guide me how to include zxing to android device.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
如果手机中安装了zxing条码扫描器,则非常简单:
在
OnActivityResult
中:如果未安装:您可以将此代码放在try-catch块中并捕获异常,您可以这样做:
因此,它将应用程序重定向到
android market
,并且如果安装了条形码扫描仪
,您的应用程序将继续运行一次。如果你不想在你的应用程序中使用其他应用程序,你必须下载 zxing 库并尝试使用 core.jar 文件中的类(它是使用 apache ant 创建的)。按照本教程执行此操作:
https://github.com/zxing/zxing/wiki/Getting-Started-Developing
所有 Intent 选项都可以在此处找到:
http://code.google。 com/p/zxing/source/browse/trunk/android/src/com/google/zxing/client/android/Intents.java
If the zxing barcode scanner is installed in the mobile, its very easy:
and in
OnActivityResult
:If its not installed: u can put this code in try-catch block and catching the exception, u can do this:
So it redirects the app to
android market
and ur app continues running once if thebarcode scanner
is installed.If u dont want to use the other app in ur app, U have to download zxing library and try using the classes from core.jar file(it is created using apache ant). Follow this tutorial to do that:
https://github.com/zxing/zxing/wiki/Getting-Started-Developing
All Intent options can be found here:
http://code.google.com/p/zxing/source/browse/trunk/android/src/com/google/zxing/client/android/Intents.java
您需要下载 Zing 的 .Jar 文件和添加到您的应用程序文件夹中。然后你可以调用classes &它的方法。
You need to download the Zing's .Jar file & add in to your application folder. Then you can call classes & methods of it.
在 eclipse 中逐步设置 zxing 3.2.1
Step by step to setup zxing 3.2.1 in eclipse