2

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.

Santosh
  • 201
  • 1
  • 4
  • 14
  • What does "I am not able" means? Do you try to get the source code from svn? (here : http://code.google.com/p/zxing/source/checkout) – grattmandu03 Oct 09 '13 at 09:40
  • @grattmandu03 I have edited the question – Santosh Oct 09 '13 at 10:57
  • Yes I saw this, but I still don't understand where is your issue. Cause I got a folder called "core" into the Zxing2.2.zip with source code. So you can use (and modify) theses files into Eclipse and then use them as library (with classpath) into your project. I don't see the difficulty here, I'm sorry. – grattmandu03 Oct 09 '13 at 12:22
  • 1
    @grattmandu03 Can you just brief me how to bring the core source into eclipse and make it as library project? Steps I followed are. created a new android project. copied the complete core src folder into android src. made this project as library project tried to use the project as library in android app(found in .zip) but nor able to use it – Santosh Oct 09 '13 at 13:41
  • I'm not sure you can use an Android project as a library into another Android project. Steps to follow: Create a new Java project, copy the complete src folder into src folder, then select your own Android project and go in "Properties/Build Path" then import a library by selecting, in the list proposed, your Java project. (For the last step, I'm not using Eclipse right now so the location for the project import could be a little bit different). – grattmandu03 Oct 09 '13 at 14:09
  • Maybe more information here: http://stackoverflow.com/questions/9649156/how-to-include-a-java-project-in-an-android-project or here: http://stackoverflow.com/questions/7736664/import-source-java-project-in-android-project – grattmandu03 Oct 09 '13 at 14:13
  • 1
    thanks @grattmandu03 I will edit the post for the answer – Santosh Oct 09 '13 at 16:18
  • Maybe you could put your solution as an answer of your question, in order to mark it as answered (2 days after) and to dequeue it from the unanswered question queue. – grattmandu03 Oct 10 '13 at 09:47

1 Answers1

6

Solved

prerequisties download latest zxing package.

Process 1

  1. create a java project in eclipse.and name it to something like ZxingCore.
  2. copy and paste complete src folder inside core folder.
  3. In case you need to edit any code, you can do it. otherwise skip this step.
  4. Java library is ready to be used.

[Note: Compile Java project using Java 1.6 to get rid of run time exceptions]

Process 2

  1. In eclipse select Create a android project from existing source.
  2. browse your zip file for android folder[this is a sample project bundeled with the library] your project should be imported with few errors
  3. The actual core library is missing, We should add the ZxingCore library from process 1
  4. right click project -> properties -> JavaBuildPath(from left pane) -> project tab -> add -> check ZxingCore - Ok.
  5. All the errors should have gone now. it time to make the barcode scanner app to be a library project
  6. right click project -> properties -> android(from left pane) -> check isLibrary -> apply -> OK.
  7. Now you will get errors in some switch case statements. Convert the problematic switch case statements to it..elseif
  8. Your library project is ready
  9. for those who want to run the barcode scanner as a stand alone app skip the steps 5,6,7,8
Santosh
  • 201
  • 1
  • 4
  • 14