Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google App Engine - Cloud Endpoints - Application name is not set

I just started Google Cloud Endpoints.

When running android app, I have the following warning in logcat:

Tag: AbstractGoogleClient
Text: Application name is not set. Call Builder#setApplicationName.

Where to set Application name? Is it in android or app engine/cloud endpoints?

like image 832
JR Galia Avatar asked Dec 19 '13 02:12

JR Galia


People also ask

What are endpoints in Google Cloud?

Endpoints is an API management system that helps you secure, monitor, analyze, and set quotas on your APIs using the same infrastructure Google uses for its own APIs.

How many App Engine applications can you create in a GCP project?

You can only have one App Engine App per project. However you can have multiple services and multiple version for each service. Yup. You can create multiple services under the same app.


1 Answers

The Class com.google.api.client.googleapis.services.AbstractGoogleClient has a function

public Builder setApplicationName(String applicationName) {
      this.applicationName = applicationName;
      return this;
    }

When using Gradle to generate your client libraries using appengineEndpointsInstallClientLibs You should be able to create an endpointbuilder for your endpoints:

private YourEndpoint.Builder endpointBuilder = new YourEndpoint.Builder(
            AndroidHttp.newCompatibleTransport(), new JacksonFactory(),
            new HttpRequestInitializer() {
                public void initialize(HttpRequest httpRequest) {
                }
            }
    );

then... to get rid of the warning:

endpointBuilder.setApplicationName("Some crazy App Name");
like image 59
Tom Bevelander Avatar answered Nov 10 '22 00:11

Tom Bevelander