How to use ZXing library without installing barcodescanner app

Raghavendra Nilekani picture Raghavendra Nilekani · May 8, 2013 · Viewed 43k times · Source

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.

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);

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 ?

Answer

shaonAshraf picture shaonAshraf · May 8, 2013

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.