Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

sharing code between projects in eclipse

I have two projects that I want to share some code, So I set up a third project to hold just the code to be shared, but now i'm not sure what to do. I tried adding it to the java build path library, but that didn't seem to help...

like image 918
Chimeara Avatar asked Oct 09 '22 02:10

Chimeara


2 Answers

You want to create a Library Project. Sources and Resources from a Library Project can be used from other Android Projects.

like image 143
thaussma Avatar answered Oct 13 '22 12:10

thaussma


make a new project and paste the shared code there. Then right click the project, if using eclipse, and under "android" you can make it a library with checking "is Library". From your project you want to implement the shared code, right click on that project and under "android" you can click "add", and the shared project should be in that dialog.

This is done because eclipse cant export .jar files from projects in your workbench.

http://developer.android.com/guide/developing/projects/projects-eclipse.html

like image 37
nahwarang Avatar answered Oct 13 '22 10:10

nahwarang