5

If I decided to use a library project in mine I still have to keep this library project in my workspace. Is there a way to avoid this? Also, does it mean I have to deliver an addition folder of library project with a folder of mine?

2 Answers 2

3

Library projects works like a charm, but of course you need to keep them open in the workspace as everytime eclipse builds your project it needs to access all the stuff from the library project.

If you don't want to keep this project open AND you don't plan to change it a lot AND it's not an Android project, it's a JAVA commom project you can build it once and instead of using a library project reference a JAR in your android project

Sign up to request clarification or add additional context in comments.

3 Comments

You might consider creating a .jar from the sources and attach it in Eclipse to that library too - in case you want to peek at library implementation.
@Rafael Roman , just a clarification, let say opted to create a JAVA common project, is it ok to create a IntentService inside on it by adding android.jar into lib folder?
I'm not sure about that, but using that approach you can generate a new jar containing all the code and use this jar as a library on your project, as the jar will be contained within your real project, anything you can do in a regular project, you can do on the lib/jar. just be careful to use the right jar (android-8,android-9, whatever)
1

If you want to do this outside of Eclipse, (say you're building from the terminal with ant, ie. in continuous integration, or if you just hate Eclipse.) Just place the library project in an adjacent directory. In your main project, edit project.properties to include:

android.library.reference.1=../LibraryFolderName 

If you have more than one library to add, just number them accordingly, ie.

android.library.reference.1=../LibraryFolderName android.library.reference.2=../AnotherLibraryFolderName 

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.