0

there are so many examples but I am still not able to add this, because this is showing different errors..

someone please tell me how to add this project to my project as a library. I need zxing library

please tell me how to add as a module

TeaAge
  • 152
  • 1
  • 16
TechDubey
  • 3
  • 6
  • You just need to add the dependency in your build gradle. To get better advicr please be more specific about what you are actually trying to achieve. – Xaver Kapeller Aug 05 '16 at 06:45
  • I am making a barcode scanner app.. I need library (zxing lib)., I tried so many files but no one is working....... – TechDubey Aug 05 '16 at 07:27
  • 1
    Possible duplicate: http://stackoverflow.com/questions/27851512/how-to-integrate-zxing-library-to-android-studio-for-barcode-scanning – Micky Aug 05 '16 at 07:52

2 Answers2

0

You can include this library,it's based ZXing
Add the following to your build.gradle file:

repositories {
    jcenter()
}

dependencies {
    compile 'com.journeyapps:zxing-android-embedded:3.3.0'
    compile 'com.android.support:appcompat-v7:23.1.0'   // Version 23+ is required
}
Vito
  • 1,080
  • 9
  • 19
0

There is a library called ZXing Android Embedded which uses ZXing internally. This library is easy to be integrated with your current Android project.

As instructions say, you should add the following lines to your module build.gradle file.

dependencies {
    compile 'com.journeyapps:zxing-android-embedded:3.3.0'
    compile 'com.android.support:appcompat-v7:23.1.0'
}

Note that you should have com.android.support:appcompat library installed. In this example version 23.1.0 of it is being used, you may change it.

Also note that if you already have a dependencies section in your build.gradle file, it's enough to add the compile lines to that section.


Alternatively you can download the library manually from bintray and add it to your project.

Community
  • 1
  • 1
frogatto
  • 28,539
  • 11
  • 83
  • 129
  • Error:No cached version of com.journeyapps:zxing-android-embedded:3.3.0 available for offline mode. Disable Gradle 'offline mode' and sync project showing this and when i disable this it is showing this->> (Now it is showing this..while sync).. Error:Unknown host 'services.gradle.org'. You may need to adjust the proxy settings in Gradle. – TechDubey Aug 05 '16 at 08:28
  • @SahityaDubey First disable 'offline mode' and then establish a live Internet connection. Android Studio needs to access `jcenter` repository and download the library. – frogatto Aug 05 '16 at 08:30
  • yeah I disable this ->> "Error:Unknown host 'services.gradle.org'. You may need to adjust the proxy settings in Gradle. Learn about configuring HTTP proxies in Gradle" ...........it is still there.. – TechDubey Aug 05 '16 at 08:33
  • @SahityaDubey Is your Android Studio connected to the Internet? – frogatto Aug 05 '16 at 08:33
  • @SahityaDubey It seems your Android Studio can't access the Internet. Ok, you can alternatively [download](https://bintray.com/journeyapps/maven/download_file?file_path=com%2Fjourneyapps%2Fzxing-android-embedded%2F3.3.0%2Fzxing-android-embedded-3.3.0.aar) the library manually and add it to your project. – frogatto Aug 05 '16 at 08:41
  • Thanxxx @HiI'mFrogatto For help.... that problem has resolved... :) :) – TechDubey Aug 08 '16 at 06:55