Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to move Cloud Endpoints generated sources.jar library into Android project

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.

like image 475
aez Avatar asked Dec 27 '22 07:12

aez


1 Answers

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"

like image 106
aez Avatar answered Feb 14 '23 15:02

aez