Google App Engine - Cloud Endpoints - Application

2019-04-22 18:49发布

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?

1条回答
我欲成王,谁敢阻挡
2楼-- · 2019-04-22 19:27

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");
查看更多
登录 后发表回答