如何将Zxing库包含到android项目中? [英] How to include Zxing library to android project?

查看:481
本文介绍了如何将Zxing库包含到android项目中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在stackoverflow中读到了这个问题的一些答案,但它对我不起作用。我已经有了一个项目,现在我想将QR码和条形码阅读器集成到我的项目中。



我从以下网址下载了zip文件: core-2.2.zip



<我没有找到任何core.jar,我读到我必须整合core文件夹中添加的文件。我是否必须将所有类添加到我的项目(整个文件夹)?或者我是否必须使用该文件夹创建一个jar文件?



我正在使用Android Studio。任何人都可以帮助我吗?谢谢

解决方案

确实有一个Android应用程序是ZXing项目的一部分。
它使用maven central发布的核心模块。如果您有maven项目(大多数Android应用程序不太可能),您可以将以下依赖项添加到 pom.xml 文件中:

 < dependency> 
< groupId> com.google.zxing< / groupId>
< artifactId> core< / artifactId>
< version> 3.2.0< / version>
< / dependency> Gradle 项目的

 编译'com.google.zxing:core:3.2.0'

或者您可以直接从这里



请注意,这个答案是指版本3.2.0,这是最新稳定的。版本2.2可以类似地获得。


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

解决方案

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.

这篇关于如何将Zxing库包含到android项目中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆