Google Plugin for Eclipse includes a facility to automatically generate the cloud endpoints client library. But there doesn't seem to be an easy way to move the generated source.jar file into your Android source.
The documentation https://developers.google.com/appengine/docs/java/endpoints/consume_android says
The Endpoints generation results in a sources jar file. Add the contents of this jar file to your Android project.
It doesn't seem possible to put the source.jar file into an Android /lib or /libs, since the source is .java rather than .class form. So I just manually copy over the source generated by GPE (which they put in an endpoints-lib folder in your AppEngine project). This can be extremely cumbersome especially when you have more than one endpoint and are editing it often.
See also Error connecting android app to Google Cloud Endpoints: could not find class
Does anyone know of a way to actually use the sources.jar file directly in the Android project? Thanks.
The idea is that the wizard that generates the client library also copies it into your client project.
But that depends on e.g. how you initially created your projects, and even if it does work, what if you have multiple clients projects, or change your client project... so here are some ideas:
I found a file that specifies which project the client libraries will get copied to (in the .settings folder): com.google.gdt.eclipse.appengine.swarm.prefs:
connectedProject=[target-android-project-name]
eclipse.preferences.version=1
Manually changing this file worked for me, but I haven't tried manually creating it if it doesn't exist.
Clearly that is is not a great solution, so..
This problem is solved in Eclipse by adding a linked resource to the directory at
your-appengine-project/endpoint-libs/libYourEndpoint-v1/yourendpoint/yourendpoint-generated-source/
You can do this in Eclipse by adding a source link in Properties->Java Build Path->Source Link
After this your Android or client project will see any changes generated using "Google->Generate Client Endpoint Library"