ActivityNotFoundException while using ZXing - android

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.

Related

How to use ZXing library without installing barcodescanner app

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.

Zxing intentIntegration usage

I am trying to implement a custom barcode scanner. If I have Zxing installed the app works fine but If I do not the application will error out and you have to force close. I have added IntentIntegrator.java and IntentResult.java into the SRC folder of my project and changed the package name to point to my package, although Im not sure if that is what I am supposed to do. It still will not work. Am I setting this up correctly? I have found many pages that tell me to use the files but not how to set them up to work.
I would like it to smoothly direct the user to download the zxing app from the market if it is not installed on the client phone.
It's because you are not handling ActivityNotFoundException, or checking first to see if the app is installed. That is up to you. But, if you used the provided integration code, it would do this all for you. See http://code.google.com/p/zxing/wiki/ScanningViaIntent
It's not going to launched your app though, no.

Android, Except ZXing is there any other third party library for reading Qr codes?

In my project I need to read Qr codes. I know how to call Zxing with Intent and if there was not install in device, how to direct user to android market in order to download it.
Based of request, I shouldn't use third party application therefore I decided to add zxing library to my project. Also, I know what should I do and how to add it as library. Before releasing ADT 18, I was successful to use integrate zxing as library into my other applications but i'm really amaze why I can't do it after upgrading to ADT 18. Each time compiler says Dalvik Machin encountered error 1; and nothing more.
I'm sure I set everything correctly but there is problem. Last two days I was working on it and i'm sure something has problem that I don't know what!
If you know other Or library (in .jar format) that i can integrate it to my application please tell me.
Any suggestion would be appreciated. Thanks
You can try OBSQR
https://bitbucket.org/trikita/obsqr

Integrating Zxing 1.7 into Android app

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.

Integrate zxing code with the application and install in on Android os higher than 1.5

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.

Categories

Resources