谷歌日历:如何在 Android 上访问它
现在在 Android 上访问谷歌日历的最佳方式是什么?
我找到了以下方法:
google-api-java-client - 这只是一个 alpha 版本。身份验证、获取日历列表有效,但更新日历在示例中崩溃。 +无论如何,没有文档和错误的示例代码。
黑客攻击逆向工程 -听起来也很糟糕,(可能)不是面向未来的。
Google 数据 api - 就目前而言我知道,它不支持/在 Android 上运行。
有没有我错过的替代方案?有没有可行的例子?
What would be the best way to acces the google calendar on android right now?
I found the following ways:
google-api-java-client - It's only an alpha. Authenticating, getting calendar list works, but updating calendar crashes in sample. +no documentation and bad sample codes anyway.
hackity hack reverse engeneering - Sounds bad, also, (propably) not futureproof.
Google data api - As far as I know, it does not support/work on android.
Are there any alternatives that I have missed? Are there any working examples out there?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
我最近为此使用了 SignPost。它处理 OAuth,您可以使用它来签署 HTTP 请求以获取数据或将数据发布到您的日历。我在让 Google 的 Java API 与 Android 配合使用时遇到了麻烦,因为我认为它依赖于 Android 中不一定存在的 Java API。
要提出请求,您可以参考此页面:http://code .google.com/apis/calendar/data/2.0/developers_guide_protocol.html
I recently used SignPost for this. It handles OAuth, and you can use it to sign your HTTP requests to get or post data to your calendars. I had trouble getting Google's Java API to work with Android since I think it relies on Java APIs that are not necessarily present in Android.
To make your requests, you can refer to this page: http://code.google.com/apis/calendar/data/2.0/developers_guide_protocol.html
您是否看过数据 API 开发人员指南:Java?如果情况允许,您还可以直接使用 HTTP 请求/响应 Java API 不支持您想要/需要的内容。
我个人没有使用过 Java API,但我直接使用过 HTTP,发现它非常简单。
Have you looked at the Data API Developer's Guide: Java? You can also work directly with HTTP request/response, if things you want/need aren't supported in the Java API.
I haven't personally used the Java API, but I have worked directly with HTTP, and found it to be pretty straightforward.
我认为这是一个众所周知的问题,但还不是很清楚。查看提供的所有问题和答案,似乎您有两个选择:
使用您在答案中引用的技巧(根本不建议,因为正如您所说,不能保证相同的技巧将来会起作用)。为了使其即使在 froyo 下也能正常工作,已进行了一些更新,请参阅 这里。
使用此http://code.google.com/p/google -api-java-client/。引用网站上的项目描述
`
I think that this is a well known issue, but not so well clear yet. Looking at all the questions and answer provided it seems that you have two options:
Use the hacks you were refering in your answer (not suggested at all, because as you said there is no guarantee that the same trick will work in future). Some updates have been made in order to make it works even under froyo, see here.
Use this http://code.google.com/p/google-api-java-client/. Quoting from the project description on the website
`
包含来自 gdata api 的这些(Calendar-2.1、client 1.0、core 1.0)jar 文件,并在我们的应用程序中包含两个外部 jar 文件。这两个文件(guava-11.0.2 和 jsr305 )可在 gdata 的 deps 文件夹中
找到从日历中检索事件的代码
在全局范围内声明您的日历 ID 和密码
您可以使用 facebook.com/rajivbawa22 上的此地址在 facebook 上与我联系以获取更多教程,
但请确保您在 Gmail 中也有帐户就像在谷歌日历中一样,
尝试{
查看日志中的结果并提供反馈
Include these(Calendar-2.1,client 1.0,core 1.0) jar files from gdata api and include two external jar files in our application.. Those two files (guava-11.0.2 and jsr305 ) are available in deps folder of gdata
and this code for retrive events from calendar
Declare globally your calendar id and password
you can reach to me on facebook by using this address on facebook.com/rajivbawa22 for more tutorials
but make sure you have account in gmail as well as in google calendar
try {
see result in logs and give yours feedbacks