Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to include Zxing library to android project?

I have read some answer for this question in stackoverflow, but it is not working for me. I have already a project, and now I want to integrate QR Code and barcode reader into my project.

I downloaded the zip file from: core-2.2.zip

I didn't find any "core.jar", I read that I have to integrate files added in "core" folder. Do I have to add all classes to my project (the whole folder)? or do I have to create a jar file with that folder?

I am using Android Studio. Any one can help me? thank you

like image 278
Vannian Avatar asked Jun 10 '13 15:06

Vannian


People also ask

How do I use ZXing library on Android?

In order to use the Zxing library in our application we need to add it's dependency in our application's gradle file. For adding the dependency Go to Gradle Scripts > build. gradle(Module: app) and add the following dependencies. After adding the dependency you need to click on Sync Now.

Is ZXing library open source?

ZXing ("zebra crossing") is an open-source, multi-format 1D/2D barcode image processing library implemented in Java, with ports to other languages.


2 Answers

There is indeed an Android application that is part of the ZXing project. It uses the core module released in maven central. If you have a maven project (which is unlikely for most Android applications) you can add the following dependency to your pom.xml file:

<dependency>
    <groupId>com.google.zxing</groupId>
    <artifactId>core</artifactId>
    <version>3.2.0</version>
</dependency>

for a Gradle project:

compile 'com.google.zxing:core:3.2.0'

or you can directly download the compiled .jar from here.

Please, notice that this answer refers to version 3.2.0 which is the latest stable one. Version 2.2 could be similarly obtained.

like image 79
mhcuervo Avatar answered Sep 29 '22 09:09

mhcuervo


For QRCode reading you can also use Google Play service 7.8 and beyond. You may check this link from Google.

like image 43
Jayakrishnan Salim Avatar answered Sep 29 '22 09:09

Jayakrishnan Salim