Reputation: 2770
Is it possible to import an existing Java project which is in my workspace, in an Android project which is also in my workspace? The Java project doesn't use stuff that is incompatible with Android. I could do it using a .JAR, but since I'm modifying the Java project a lot, I would like to import the whole source code and change it once in a while. Is it possible? Thanks
Upvotes: 6
Views: 6715
Reputation: 1673
This is somewhat of a hack, but worked for my project:
This setup will compile the plain-java code as Dalvik bytecode. In my case, I had pure java code with very limited dependencies, but wanted to share the pure java code with non-Android projects, instead of separately maintaining these files in every project.
Upvotes: 4
Reputation: 40193
You can link another projects to your current project. Right click on your main project, choose Build Path -> Configure Build Path...
In the dialog choose the Projects
tab, then click Add..
button. Now choose the project you want to link and click OK
. You'll now be able to use this project's sources inside your main project. Hope this helps.
Upvotes: 0
Reputation: 128428
I think you are talking about referencing other projects into the current project, if this is the case then you can do this by Right click on project, properties->Project Reference.
Upvotes: 1