Google App Engine - Cloud Endpoint - 未设置应用名称



我刚刚启动了Google Cloud Endpoints。

运行安卓应用程序时,我在logcat中有以下警告:

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

在哪里设置应用程序名称?它是在安卓还是应用引擎/云端点中?

com.google.api.client.googleapis.services.AbstractGoogleClient有一个函数

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

使用 Gradle 通过appengineEndpointsInstallClientLibs生成客户端库时您应该能够为终端节点创建终端节点构建器:

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

然后。。。要摆脱警告,请执行以下操作:

endpointBuilder.setApplicationName("Some crazy App Name");

最新更新