I can't understand why my endpoint works perfectly fine in Google APIs Explorer and not on Android.
In fact it almost works as I can see that the call is made to my GAE endpoint server side and that the user perfectly authentified via OAuth.
There seems to be something wrong in the way the data is sent back to the phone.
Here are the logs I get on the phone :
07-28 15:12:53.305: W/System.err(3034): com.google.api.client.googleapis.json.GoogleJsonResponseException: 400 Bad Request
07-28 15:12:53.305: W/System.err(3034): {
07-28 15:12:53.305: W/System.err(3034): "code": 400,
07-28 15:12:53.305: W/System.err(3034): "errors": [
07-28 15:12:53.305: W/System.err(3034): {
07-28 15:12:53.305: W/System.err(3034): "domain": "global",
07-28 15:12:53.305: W/System.err(3034): "message": "java.lang.IllegalArgumentException: name cannot be null or empty",
07-28 15:12:53.305: W/System.err(3034): "reason": "badRequest"
07-28 15:12:53.305: W/System.err(3034): }
07-28 15:12:53.305: W/System.err(3034): ],
07-28 15:12:53.305: W/System.err(3034): "message": "java.lang.IllegalArgumentException: name cannot be null or empty"
07-28 15:12:53.305: W/System.err(3034): }
07-28 15:12:53.305: W/System.err(3034): at com.google.api.client.googleapis.services.json.AbstractGoogleJsonClientRequest.newExceptionOnError(AbstractGoogleJsonClientRequest.java:111)
The object sent back is a really simple POJO as you can see in Google APIs Explorer.
EDIT1:
Android side code mostly taken from the TicTacToe example :
settings = getSharedPreferences("PronoCities", 0);
credential = GoogleAccountCredential.usingAudience(
this, "server:client_id:<myid>.apps.googleusercontent.com");
setAccountName(settings.getString(PREF_ACCOUNT_NAME, null));
Pronocities.Builder builder = new Pronocities.Builder(
AndroidHttp.newCompatibleTransport(), new GsonFactory(), credential);
service = builder.build();
Any help will be greatly appreciated.
François
Using google-api-client-1.15.0-rc librairies and running on a Samsung Galaxy S3 / Android 4.1.2.