【发布时间】:2012-06-15 01:26:33
【问题描述】:
我浏览了 2 个不同的 Google 日历代码示例。读完之后,我有点糊涂了。
https://developers.google.com/google-apps/calendar/instantiate
- 他们正在使用 oAuth2?
- 他们正在使用范围
https://www.googleapis.com/auth/calendar。是因为他们使用的是 oAuth2 吗? - 他们需要 2 个 API 密钥,
clientId和clientSecret。是因为他们使用的是 oAuth2 吗? - 他们正在使用
com.google.api.services.calendar.Calendar。
- 他们正在使用 ClientLogin?
- 范围是
cl?是因为他们使用的是 ClientLogin 吗? - 它们只需要 1 个简单的 API 访问密钥。是因为他们使用的是 ClientLogin 吗?
- 他们正在使用
com.google.api.services.calendar.model.Calendar。与com.google.api.services.calendar.Calendar有什么区别?
我的目标平台是 Android。我应该使用第一个示例还是第二个示例中的方法?
【问题讨论】:
-
如果您查看第二个示例的主页,我看到的第一件事是他们声称使用 oAuth 2.0,与第一个相同。
-
@Nanne,我没有看到任何声明表明第二个示例正在使用 oAuth 2.0。你能指出来吗?
-
转到该项目的主页 (code.google.com/p/google-api-java-client)。阅读 tekst 的第一行:
Written by Google, this library is an easy-to-use and efficient Java client library for accessing Google APIs using JSON and **OAuth 2.0.**(emph mine) -
令人困惑。但是@sandis 说第二个例子是ClientLogin?谁能确认第二个示例是使用 oAuth 2.0 还是 ClientLogin?谢谢。
-
不,据我所知@sandis 说 oAuth 和 clientlogin 都可以工作,没有提到哪个示例的作用。无论如何,项目本身说它使用 oAuth,为什么要怀疑呢?
标签: android google-api google-calendar-api google-api-java-client