user2581076
user2581076

Reputation:

how to import zxing library project for android app in eclipse

check out zxing from Svn reository

then in zxing folder i found several folders ,i don't know which one is used to integrate zxing library in android app,here i am placing the zxing folder after checkout. Zxing folder with several folders

Upvotes: 1

Views: 22544

Answers (3)

Hitesh Sahu
Hitesh Sahu

Reputation: 45140

I have rewrite

https://github.com/journeyapps/zxing-android-embedded

for adt and eclipse.You can get source for github here

https://github.com/hiteshsahu/XZing-Barcode-Scanner-Minified-Eclipse

I have also merged packages so that you can just copy paste them in your project without making your project look huge.

Just drop 3 source code packages and 2 layout files in your project and you are good to go.

For more detail read my answer here Integrating the ZXing library directly into my Android application

Upvotes: 0

Hubert Solecki
Hubert Solecki

Reputation: 2771

I've just figure out how to do it by surfing on the web and testing all the tutorials that are pretty similar but few works when integrating on eclipse without the need of building with Maven or even Ant.

Downloads: Downloads the zip folder TDBarcodeQRScanner: here.

  1. Unzip the folder, inside the folder, you will find two projects. Copy-paste the project LibraryBarQRCodeScanner into your workspace.

  2. Add a new Android project from existing source code. Navigate to the root folder of the project --> Select --> finish. The project appears in the workspace. With errors.

  3. Right click on the newly added project and --> Properties --> Android. Under Android uncheck Google API and check the targetted API of your choice. Check the IsLibrary checkbox if it's not checked.

  4. Clean and build the project. Errors disappears.

  5. Go to your project. Right click --> Properties --> Android --> Library --> Add --> add the project newly added. The project is added as library to your project.

  6. Modify the activity from which you are launching the App in order to fire the scan. As the MainActivity.java from the other project included in the unzipped folder.

After hours of search, it's the only method that works for me. As I wanted to scan code bars and not QRCode, and it's the case for you, just replace the SCAN_MODE extra value "QR_CODE" to "SCAN_MODE"

Happy integration !!

Upvotes: 1

Shobhit Puri
Shobhit Puri

Reputation: 26017

Checkout Integrating the ZXing library directly into my Android application question and answers on Embed Zxing library without using Barcode Scanner app question.

I'm quoting the answer of Sean Owen, one of the author's of Zxing library from this answer:

  • " The complete source code is available from the ZXing project. You want to build core.jar from core/ and put it in your Android lib/ folder to include the core decoder in your app. You do not want to include javase. You can look to the code in android/ as it is the source to Barcode Scanner, but as the authors we'd suggest you not just copy and paste it."

Hope this helps.

Upvotes: 4

Related Questions