I want to integrate Zbar into my application but cant seem to figure out how to accomplish this using the new Android Studio.
I have looked through the example and have copied over the code without any issues. The problem I am having is adding the libs to my project I cant seem to figure out how to do it. Could someone walk me through it?
Actually, @Michael's answer is correct, it is also obsolete. Now, using gradle all you need to do is to add the lines below in the build.gradle file:
or directly put your .so libraries into:
This way, when you build your application or library, the jni libraries are being copied into destination .jar/.aar file.
I've built
ZBarAndroidSDK-0.2
example in Android Studio 2.0 by just opening CameraTest project from example folder.It restructured the project from eclipse to Android Studio automatically. That is it.
I'm not particularly familiar with IntelliJ or Gradle but I have figured it out. I used
ZBarAndroidSDK-0.2
.libs/
folder into your project'slibs/
folder.File > Project Structure > Libraries > + Sign > Java
and find zbar.jar with the file picker. Add it to your project.Add the following to your build.gradle (making sure to keep whatever other dependencies you've got):
My build.gradle is based on this gist: https://gist.github.com/khernyo/4226923.
If your using gradle 1.1.0 then you must do some modifications to @Michael's answer. Here is the revised code of gradle file which works for me.