I am creating an Android application (like an Eclipse project) that needs to access a web service. We will send data from the service as serialized JSON classes, so we want to share some classes between the Android application and the server application. We now think we need to do this in order to structure our Git repository with three folders. One for the client, one for the server and one for the shared library.
But at this point, we could not understand how to create common code. It looks like we can put all .java files in a folder and then create a relative link to this folder from other projects, but is this a good way to do this?
Another opportunity we discovered was to create another project in Eclipse and then incorporate the library project into the client project. However, we ran into a problem. How can we make the library usable by both server and Android? If I create a new Java project in Eclipse, I have to choose a JRE to create, but Dalvik is not an option, and even if I could use a library with a desktop virtual machine if the library was compiled for Dalvik?
source
share