Google App Engine - 云端点 - 应用程序名称未设置 [英] Google App Engine - Cloud Endpoints - Application name is not set
问题描述
运行android应用程序时,我在logcat中发出以下警告:
标记:AbstractGoogleClient
文本:未设置应用程序名称。调用Builder#setApplicationName。
在哪里设置应用程序名称?它是在Android还是应用引擎/云端点?
类 com.google.api。 client.googleapis.services.AbstractGoogleClient
有一个函数
public Builder setApplicationName(String applicationName){
this.applicationName = applicationName;
返回此;
}
使用使用 appengineEndpointsInstallClientLibs
$ b生成客户端库 $ b您应该可以为您的端点创建endpointbuilder:
private YourEndpoint.Builder endpointBuilder = new YourEndpoint.Builder(
新的HttpRequestInitializer(){
公共无效初始化(HttpRequest httpRequest){
}
}
新的JacksonFactory(),
) ;
然后...摆脱警告:
endpointBuilder.setApplicationName(Some crazy App Name);
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?
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");
这篇关于Google App Engine - 云端点 - 应用程序名称未设置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!