1

I want to integrate the zxing source code to my Android application. I have downloaded the zxing1.5 and integrate the whole code to my application and I am calling the activity "CaptureActivity" through intent.

It is showing only the camera view but it is not scanning the barcode. How can I solve this problem - I want my application to be stand alone. I don't want to install BarcodeScanner.apk separately in the device.

halfer
  • 19,824
  • 17
  • 99
  • 186
Sujit
  • 10,512
  • 9
  • 40
  • 45

2 Answers2

6

I don't think CaptureActivity is what you want - instead, you should be using com.google.zxing.client.android.SCAN.

See the article How to scan a barcode from another Android application via Intents for code samples, and links to further related articles.

RichieHindle
  • 272,464
  • 47
  • 358
  • 399
  • 1
    Thanks for your quick reply but i don't want to call the "BarcodeScanner.apk" that has been already installed in the device. I want my application to be stand alone .So i want to integrate the zxing android code to my application. hope you can understand. Thanks – Sujit Apr 23 '10 at 07:20
  • @Sujit: Ah, I see. Then I guess you need to merge the original ZXing XML file with yours, but change `com.google.zxing.client.android.SCAN` to `com.sujit.zxing.client.android.SCAN` or similar, and then fire an intent for `com.sujit.zxing.client.android.SCAN`. – RichieHindle Apr 23 '10 at 08:00
  • original ZXing XML means AndroidMainefest.xml or what. thanks... – Sujit Apr 23 '10 at 11:22
  • Yes, AndroidManifest.xml. Specifically the part that says ` ... ` – RichieHindle Apr 23 '10 at 11:30
  • Ok i got it...let me test it on device Thanks.. – Sujit Apr 23 '10 at 11:35
  • No its not working. I have changed the AndroidMainefest.xml and provide the package name as you have specified still it is not scanning at all. I am not getting it why it is not scanning. The BarcodeScanner android code is working fine and it is calling the CaptureActivity by intent but when i am calling the same activity in my application it is not scanning. Thanks... – Sujit Apr 23 '10 at 13:44
  • If you've changed everything to refer to your own package, and left everything else the same, then I'm afraid I don't know why it's not working. – RichieHindle Apr 23 '10 at 14:08
-1

I could do that! You need to copy the entries in main.xml which contain

"android:name="com.google.zxing.client.android.SCAN"
stealthyninja
  • 10,343
  • 11
  • 51
  • 59
Andev
  • 1