如何在不安装条形码扫描仪应用程序的情况下使用ZXing库 [英] How to use ZXing library without installing barcodescanner app

查看:164
本文介绍了如何在不安装条形码扫描仪应用程序的情况下使用ZXing库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在开发一个Android应用程序,以扫描条形码和QR码并将结果发送到其他应用程序(HTTP).我已经通过Internet阅读了大多数文档,并且在整个流程中都已阅读并使其正常运行.我可以在设备上运行独立的zxing android应用程序,也可以运行自己的独立android应用程序以使用Zxing Intent扫描条形码. 但是,即使在阅读了如此多的问题和互联网上的一些博客之后,我仍然无法满足我的严格要求.

I have been developing an android app to scan the barcode and QR code and send the results to some other application (HTTP). I have read most of the documentation over internet and here in stack over flow and got it working. I could able to run the stand alone zxing android app on my device, also I could run my own separate android app to use Zxing intent to scan the bar code. But even after reading so many questions here and some of the blogs in internet, I could not get my strict requirements.

我想实现以下目标. 1.我不想在设备中安装单独的条形码扫描仪应用程序以使自己的应用程序正常工作(以扫描条形码). 2.我使用了以下代码

I want to achieve following things. 1. I do not want to install a separate barcode scanner app in my device to get my own app to work (to scan the barcode). 2. I used following code

Intent intent = new Intent("com.google.zxing.client.android.SCAN");
startActivityForResult(intent, 0);

,当我在自己的设备中运行该应用程序时,它会询问选择应用程序以完成此操作",并显示"Google"和"Google Goggles",并打开Goog​​le页面默认摄像头并扫描条形码.我希望CaptureActivtiy默认捕获页面(不是Google的默认捕获页面)来扫描条形码. 3.我曾尝试在自己的应用程序中将ZXing作为库使用,但没有用.

and when I run the app in my devide, it asks 'Select the application to complete this action' and it shows 'Google' and 'Google Goggles' and it opens the Google page default camera and scans the barcode. I wanted CaptureActivtiy default capturing page to come (not Google's one) to scan the bar code. 3. I have tried using ZXing in my own app as library but it did not work.

您能告诉我我到底在哪里做错了吗?

Could you please tell where exactly I am going wrong to get this done ?

推荐答案

我发现"zxing"的使用非常复杂.然后,我尝试使用"ZBar Android版本库".太简单了. 您可以从此处下载该库: http://sourceforge .net/p/zbar/news/2012/03/zbar-android-sdk-version-01-released/

I found "zxing" complicated to use. Then I tried with "ZBar Android Version Library". It was so simple. You can download the library from here: http://sourceforge.net/p/zbar/news/2012/03/zbar-android-sdk-version-01-released/

在下载的软件包中,有一个非常简单的示例.只需遵循它或将示例包含到您的应用中即可.希望您的任务能够完成.

Within the downloaded package, there is a very simple example. Just follow it or include the example to your app. Hopefully your task will be done.

这篇关于如何在不安装条形码扫描仪应用程序的情况下使用ZXing库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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