How to use ZXing library without installing barcodescanner application

I am developing an Android application to scan a barcode and QR code and send the results to another application (HTTP). I read most of the documentation on the Internet, and now on the stack over the stream, and got it working. I was able to run the standalone Android zxing app on my device, also I could run my own Android app to use the Zxing intent to scan the barcode. But even after reading so many questions here and some of the blogs on the Internet, I could not get my strict requirements.

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

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

and when I launch the application on my device, he asks “Choose an application to complete this action” and he will display “Google” and “Google Goggles” and he will open the default camera for the Google page and scan the barcode. I wanted CaptureActivtiy to collect a page (not Google) by default to scan the barcode. 3. I tried using ZXing in my own application as a library, but this did not work.

Could you tell me exactly where I am wrong to do this?

+7
source share
3 answers

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

There is a very simple example in the downloaded package. Just follow it or include an example in your application. I hope your task is completed.

+21
source

You show that you want to integrate Intent . This is the recommended way to do this, and you can make it even easier and limit the list of applications that respond with IntentIntegrator . This is about 5 lines of code: https://code.google.com/p/zxing/wiki/ScanningViaIntent

However, this contradicts what you say about the desire to implement scanning in your application. You must clarify what you want.

If so, you need to create your own scanning application and reuse core.jar and possibly the bits of the barcode scanner in android/ . This is not supported - you are on your own. Please do not clone our application.

+2
source

I think you should add your package name to IntentIntegrator

public static final List TARGET_ALL_KNOWN = list (BS_PACKAGE, // Barcode Scanner BSPLUS_PACKAGE, // Barcode Scanner + BSPLUS_PACKAGE + ".simple", // Barcode Scanner + Simple // What else supports this intention? // Your package "xyz"

-5
source

All Articles