Zxing 2.2导入为库项目(不.JAR)的日食 [英] Zxing 2.2 import as a library project(not .jar) in eclipse
问题描述
我从下面的链接下载的zxing 2.2 code
的https://$c$c.google.com/p/ zxing /下载/列表
我的要求是要导入的核心项目导入Eclipse,并添加一些code进去。然后将其标记为库项目。
我想包括这个库项目到巴code扫描仪的示例应用程序,并使用从我的项目吧code扫描仪应用程序的库。
解决
prerequisties下载最新zxing包。
处理1
- 创建它eclipse.and名称类似于ZxingCore Java项目。
- 复制和粘贴的核心文件夹内完成src文件夹。
- 在情况下,你需要编辑任何code,你可以做到这一点。否则跳过此 一步。
- 在Java库已准备好使用。
[注:使用Java 1.6编译Java项目,以摆脱运行时异常]
处理2
- 在Eclipse中,选择从现有源的Android项目。
- 在浏览Android的文件夹中的zip文件[这是一个示例项目 bundeled与库]项目应该少进口 错误
- 在实际的核心库丢失,我们应该添加ZxingCore 图书馆从工艺1
- 右键单击项目 - >属性 - > JavaBuildPath(左窗格) - >项目选项卡 - >添加 - >检查ZxingCore - 确定
- 所有的错误应该现在已经没有了。它的时间,使巴code 扫描仪的应用程序是一个库项目
- 右键单击项目 - >属性 - >机器人(左窗格) - > 检查isLibrary - >应用 - >确定
- 现在,你会得到一些开关case语句错误。转换 问题开关case语句来it..elseif
- 您的库项目已准备就绪
- 对于那些谁想要运行的吧code扫描仪作为一个独立的应用程序 跳过步骤5,6,7,8
I have downloaded the zxing 2.2 code from the below link
https://code.google.com/p/zxing/downloads/list
My requirement is to import the "core" project into eclipse and add few code into it. then mark it to be library project.
I want to include this library project into barcode scanner sample app and use the barcode scanner app as library from my project.
Solved
prerequisties download latest zxing package.
Process 1
- create a java project in eclipse.and name it to something like ZxingCore.
- copy and paste complete src folder inside core folder.
- In case you need to edit any code, you can do it. otherwise skip this step.
- Java library is ready to be used.
[Note: Compile Java project using Java 1.6 to get rid of run time exceptions]
Process 2
- In eclipse select Create a android project from existing source.
- browse your zip file for android folder[this is a sample project bundeled with the library] your project should be imported with few errors
- The actual core library is missing, We should add the ZxingCore library from process 1
- right click project -> properties -> JavaBuildPath(from left pane) -> project tab -> add -> check ZxingCore - Ok.
- All the errors should have gone now. it time to make the barcode scanner app to be a library project
- right click project -> properties -> android(from left pane) -> check isLibrary -> apply -> OK.
- Now you will get errors in some switch case statements. Convert the problematic switch case statements to it..elseif
- Your library project is ready
- for those who want to run the barcode scanner as a stand alone app skip the steps 5,6,7,8
这篇关于Zxing 2.2导入为库项目(不.JAR)的日食的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!