Google app engine Android Studio与谷歌日历API V3
我想试试谷歌日历API v3。我有Android Studio 1.0。我从androidstudio创建了一个java端点模块。我在看官方文件Google app engine Android Studio与谷歌日历API V3,google-app-engine,google-cloud-endpoints,Google App Engine,Google Cloud Endpoints,我想试试谷歌日历API v3。我有Android Studio 1.0。我从androidstudio创建了一个java端点模块。我在看官方文件 如果你遵循我提供的链接,你会看到这样一行 Calendar service = new Calendar.Builder(httpTransport, jsonFactory, credentials) .setApplicationName("applicationName").build(); 现在这里的httpTransport、js
如果你遵循我提供的链接,你会看到这样一行
Calendar service = new Calendar.Builder(httpTransport, jsonFactory, credentials)
.setApplicationName("applicationName").build();
现在这里的httpTransport
、jsonfactory
和凭证将是什么?官方文件没有具体说明什么
我还遵循了来自的java示例。
这是使用Javaservlet和Eclipse完成的。我对此并不熟悉。它在Android Studio上不起作用
谁能给我一个样品吗?或者有没有关于日历API和Android Studio的指导?或者在上面提到的官方示例中做什么?您应该将GoogleAccountCredential
作为最后一个参数传递
GoogleAccountCredential googleAccountCredential =
GoogleAccountCredential.usingAudience(context, "server:client_id:" + WEB_CLIENT_ID);
googleAccountCredential.setSelectedAccountName(userEmail);
什么是WEB\u CLIENT\u ID
你可以在互联网上的许多教程中找到。它基本上是一个ID,您可以使用Google开发者控制台为给定的项目生成它
下面介绍如何使用transport和JSON factory创建日历
实例
new Calendar.Builder(AndroidHttp.newCompatibleTransport(),
AndroidJsonFactory.getDefaultInstance(), googleAccountCredential);