1

I'm pretty new in Android programming, so sorry if I am going to ask dumb questions.

I'm creating an application, and I'm trying to integrate ZXing Barcode Scanner, following the instructions here: http://code.google.com/p/zxing/source/browse/trunk/android-integration/src/com/google/zxing/integration/android/IntentIntegrator.java

What I've done so far. I've created some buttons for my application, and put an action On Click for the button supposed to use ZXing for scanning. Value: IntentIntegrator. Then I've copy-pasted the code from the link into the file IntentIntegrator.java from my package. Following the advices given in eclipse I've created IntentResult class in com.google.zxing.integration.android package.

Here I am in this moment. For 2 days I've been reading advices, opinions, I've done started all from the beginning but it didn't work. So I'm trying again. Can anyone tell me please, step by step, how to integrate this app in my own? Or if I am right with what I've done so far, why when I run as Android project on the emulator, I get at least 20 errors, like these for exemple: http://s17.postimage.org/n9w5lddof/errors.png

Thank you!

duracell
  • 99
  • 1
  • 1
  • 6

2 Answers2

0

You have done basically the right thing. You are however including multiple copies of IntentIntegrator or have compiled against a different version than you are bundling. That is, no you have not really integrated this correctly as indicated.

The fastest thing is to copy both classes into your source tree. No other JARs or source files are needed.

Sean Owen
  • 66,182
  • 23
  • 141
  • 173
  • I've copied IntentIntegrator and IntentResult into my source tree. Nothing else. No other copies. Still the same situation. I'm a little bit lost. – duracell Jul 05 '12 at 09:56
  • Regarding the version that I'm bundling, I don't really know what are you reffering to. Build SDK 4.1, Min SDKn 2.2, AVD 4.0.3. What's wrong? – duracell Jul 05 '12 at 10:03
  • Following this: http://stackoverflow.com/questions/9720229/what-is-the-android-bundle-version-and-version-code-and-how-do-they-relate ... I discovered that my version in the manifest is 1.0 ... But I don't really know what does this change. – duracell Jul 05 '12 at 10:35
  • The error says that you compiled against one version of the code but included something different in your app. I can't say why that is. "ant clean". The versions you cite are irrelevant. – Sean Owen Jul 05 '12 at 10:45
  • Hello, I left away for a couple of weeks this application. Now I've got another problem. Following your advice, I've eliminated the errors, I'm not getting any error at all, but when I push the button that normally starts BarCode Scanner, or asks for installing it, nothing happens. Just a white screen. Any ideas why? Thanks in advance. – duracell Aug 06 '12 at 13:46
-1

are you follow these steps?

http://code.google.com/p/zxing/wiki/GettingStarted

and try this Integrating the ZXing library directly into my Android application ??

Community
  • 1
  • 1
Mohsin Naeem
  • 12,542
  • 3
  • 39
  • 53
  • Thank you for your answer. I've followed the instructions and now it's supposed to work, but I'm getting these errors: http://postimage.org/image/sh6b9ui6l/ . Any idea why? – duracell Jul 04 '12 at 12:26
  • I think you are not able to compile the project? – Mohsin Naeem Jul 04 '12 at 12:31
  • It uploads and installs the .apk on the emulator, then it crashes. – duracell Jul 04 '12 at 12:39
  • The OP is asking about integrating by Intent, which neither of these links addresses. – Sean Owen Jul 04 '12 at 14:30
  • I think you are talking about this: http://code.google.com/p/zxing/source/browse/trunk/android-integration/src/com/google/zxing/integration/android/IntentIntegrator.java ... I've already tried and it doesn't work for me. I don't know what I'm doing wrong, but I get this: http://postimage.org/image/a3q5c3kbb/ – duracell Jul 04 '12 at 14:55