I have compiled the Zxing core.jar and I have already added it to my Eclipse project, but I'm having trouble while trying to use the Zxing libraries I don't know where to start from. What I would like to do is to scan QR Codes directly from the device's camera. My actual app does show the camera preview in a SurfaceView, but it doesn't scan anything.
My question is how to actually scan from the camera? Without using the Zxing intent mechanism, I would like to embed Zxing directly into my project.
I'm a newbie, I would appreciate any kind of help you can provide me: code, links , etc. Thanks in advance.
The project has complete source code for Barcode Scanner in android/. You can just reference this.
Related
I want to build a QR code scanner app, what can I use? And can anyone teach or send me a link/s on how to build it?
I recently had to create a QR code scanner app at work and I used Zxing library (zebra crossing). It is very easy to use and you can set the QR code scanner in a couple of minutes. I helped myself with this youtube video: https://www.youtube.com/watch?v=Fe7F4Jx7rwo
I hope this helps you!
Android 2.3.3
As with most of the people using ZXing (new to using ZXing), I am getting the ActivityNotFoundException (I guess there is no need to paste my logcat as it's the same with all other people).
I have seen few questions related to ActivityNotFoundException with ZXing. Here is what I have understood so far. Please correct me if I am wrong..
If I have to use ZXing in my app, there are two options :
I can use the Intent and startActivityForResult(), if the user already has the ZXing application installed, and if doesn't, I can redirect him to the playstore to install it first and then use my application.
For my application to work, even if the ZXing application is not installed, I can add ZXing library to my project as a library, copy the code of IntentIntegrator class(from here) into a seperate class in my application and use IntentIntegrator. Is this the intended purpose of IntentIntegrator? or Am I getting it completely wrong?
Can someone help me with my doubts?
EDIT::: Seems like the second approach also needs to have the ZXing application installed on the device. Is there a way, that my application can work, without the need of ZXing app installation?
You haven't installed Barcode Scanner. Please use the IntentIntegrator as directed already in the documentation: https://code.google.com/p/zxing/wiki/ScanningViaIntent
It will handle installation for you.
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 ?
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.
You are showing that you want to integrate by Intent. That's the recommended way to do it, and you can make it even easier, and restrict the list of apps that reply with IntentIntegrator. It's about 5 lines of code: https://code.google.com/p/zxing/wiki/ScanningViaIntent
However this contradicts what you're saying about wanting to implement the scanning in your app. You should clarify what you want.
If that's the case, you need to build your own scanning app, and reuse core.jar and perhaps bits of Barcode Scanner in android/. This is not supported -- you're on your own. Please don't clone our app.
I am new to android. I am using zxing in my android project natively. I followed the steps here. But I get get classNotFoundException for capture activity of zxing lib when I call intent calling zxing android client. Also note that when I add capture activity project as library, firstly it adds properly, then when I say apply/ok & later see again then i see red x mark for this added lib. Even the src folder of added lib is not seen in source tab. I think there is some problem while adding lib but I don't know what & how to figure it out.
Please suggest.
Thank You.
The problem is that you are trying to use android/ as a library, and it is not a library. You are not supposed to copy this code and try to call it in your app. Instead, write your own app. Then integrate the core library (just core/) for decoding.
If you're new to all of this, you will probably have a lot of difficulty getting this working versus just integrating by Intent: http://code.google.com/p/zxing/wiki/ScanningViaIntent
i am working on an application that needs to scan bar codes as a functionality..I have integrated all the code of zxing with my app code and now when i try to install it on my device(OS 1.6) it gives me an "INSTALL_FAILED_CPU_ABI_INCOMPATIBLE" error...
i cant use intents to use the barcode application because that will create a necessity to have zxing installed on the device..i want my application to be standalone..
Please suggest what do i do???
I did the same thing you tried to do. I did not have any such error.
Yet, the error mentions ABI, which makes me believe the problem is NDK related. (AFAIK) ZXing doesn't use native code, so you should look at the native code in you application.