Reputation: 695
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...
Upvotes: 5
Views: 2870
Reputation: 9886
You want to create a Library Project. Sources and Resources from a Library Project can be used from other Android Projects.
Upvotes: 2
Reputation: 653
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
Upvotes: 2