如何在 eclipse 中在 Android 中包含和使用 ZXing 库?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1276635/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to include and use ZXing Library in Android with eclipse?
提问by Rajapandian
I am new to the concept of ZXing,so i want to know the step by step process to use the ZXing in android and i am using elicpse as IDE.Any one knows about it please help me.
我是 ZXing 概念的新手,所以我想知道在 android 中使用 ZXing 的分步过程,我使用 elicpse 作为 IDE。任何人都知道请帮助我。
回答by Siddharth
As advised by the moderator, I am posting what did to import zxing into my android app, on this post. Seems like many people refer to this post to get an answer for zxing.
按照版主的建议,我在这篇文章中发布了将 zxing 导入我的 android 应用程序的操作。似乎很多人参考这篇文章来获得 zxing 的答案。
The zxing guys have made it easier to create a android project with 1.7. Its not as painful as it used to be. This is a quick blog for anyone who would like to create a zxing project for android quickly.
zxing 的家伙使用 1.7 更容易地创建一个 android 项目。它不像以前那样痛苦了。这是一个快速博客,适合任何想快速为 android 创建 zxing 项目的人。
- Checkout the zxing sources from zxing.org
- Create a Android project on your eclipse
- Delete main.xml
- Right click on “src” directory and hit import. Browse to the following directories in the order mentioned. As you add them for
import one by one, ensure that you have the src directory in the edit
field of the import wizard. And that you select only the “com”
directory on the left directory tree. Do not select src.
- core
- android-integration
- android
- Ensure that your android sdk version is 9, anything lesser and androidmanifest.xml will cry.
- Strings.xml in one of the languages will crib, just put a / before the ‘ character
- 从 zxing.org 查看 zxing 源
- 在 Eclipse 上创建一个 Android 项目
- 删除main.xml
- 右键单击“src”目录并点击导入。按提到的顺序浏览到以下目录。当您将它们一一添加以进行导入时,请确保导入向导的编辑字段中有 src 目录。并且您只选择左侧目录树中的“com”目录。不要选择 src。
- 核
- 安卓集成
- 安卓
- 确保你的 android sdk 版本是 9,任何较小的和 androidmanifest.xml 都会哭。
- 其中一种语言中的 Strings.xml 将被禁用,只需在 ' 字符之前放置一个 /
For the benefit of people,
为了人民的利益,
- I have a android hello world integrated with zxing 1.7 http://www.4shared.com/file/bFx8Y5Ys/zXingJune2010.html
- Another blog that has interesting direction for integrating zxing http://damianflannery.wordpress.com/2011/06/13/integrate-zxing-barcode-scanner-into-your-android-app-natively-using-eclipse/
- 我有一个与 zxing 1.7 集成的 android hello world http://www.4shared.com/file/bFx8Y5Ys/zXingJune2010.html
- 另一个对集成 zxing 有有趣方向的博客 http://damianflannery.wordpress.com/2011/06/13/integrate-zxing-barcode-scanner-into-your-android-app-natively-using-eclipse/