Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/iphone/37.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Google app engine Android Studio与谷歌日历API V3_Google App Engine_Google Cloud Endpoints - Fatal编程技术网

Google app engine Android Studio与谷歌日历API V3

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

我想试试谷歌日历API v3。我有Android Studio 1.0。我从androidstudio创建了一个java端点模块。我在看官方文件
如果你遵循我提供的链接,你会看到这样一行

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);