Question

My android app is accessing just a single object (each containing a couple of short lists) from Objectify, but I'm getting delays of up to 15 seconds. I never get such delays using rpc in my web app to get the same objects, nor when I access the blobstore, either with android or a browser app. I thought this could be related to JSON parsing as discussed here : JSON parsing very slow in Google Cloud Endpoints but in that case we'd expect similar delays with the DevAppServer wouldn't we ?

Here's the endpoints code in the GAE app:

The Endpoint class is based on that auto-generated by GPE, minus all JDO/JPA related code

@Api(name = "myclassendpoint",namespace = @ApiNamespace(ownerDomain = "timmacp.com",ownerName = "timmacp.com", packagePath = "endpoints_in_android_app"))
public class MyClassEndpoint {

@ApiMethod(name = "getMyClassObjectByID")
public MyClass getMyClassObjectByID(@Named("id") String id) {

    MyClass object=ofy().load().type(MyClass.class)     
                    .id(EndpointUtils.URLdecode(id)).get();
    return object;
}

In the android app, I create a new EndpointsTask (extends AsyncTask) for each button press & all calls to Endpoint class are in doInBackground(..) called via execute().

First create the endpoint:

    MyClassendpoint endpoint;

    MyClassendpoint.Builder endpointBuilder = new MyClassendpoint.Builder(
            AndroidHttp.newCompatibleTransport(), new com.google.api.client.json.jackson2.JacksonFactory(),
            new HttpRequestInitializer() {
                public void initialize(HttpRequest httpRequest) {
                }
            });

    endpointBuilder=CloudEndpointUtils.updateBuilder(endpointBuilder);
    endpoint =endpointBuilder.build();

Then test with:

endpoint.getMyClassObjectByID("object1").execute();
Was it helpful?

Solution

Please see this thread for more information:

https://groups.google.com/forum/#!topic/google-appengine/3XGJFaosX9s

We are working on eliminating the need for warm-up (i.e. the first request to your API will cause the warm-up to be

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top