简体   繁体   English

Android-Google日历

[英]android - google calendar

I need to develop an app that reads info from google calendar on Android. 我需要开发一个可在Android设备上从Google日历读取信息的应用程序。 The question is, is there a way to connect to the local calendar or should I use the google calendar API and read the info from the internet? 问题是,有没有一种方法可以连接到本地日历,还是应该使用Google日历API并从互联网上读取信息? (or maybe another way) (或者另一种方式)

as far as I know, there are ways to connect to the local calendar, but non of them are official ones, and it breaks in different versions of android. 据我所知,有多种方法可以连接到本地日历,但都不是官方的,并且会在不同版本的android中中断。

(by google calendar API I mean http://code.google.com/apis/calendar/ ) (通过Google Calendar API,我的意思是http://code.google.com/apis/calendar/

Thanks 谢谢

You already answered your question yourself. 您已经自己回答了问题。

  1. There is no official way to access Calendar inside Android. 没有官方方法可以在Android内部访问日历。 There is a hack for read access: When will Android have a public Calendar API? 有一种读取访问的技巧: Android何时将拥有公共Calendar API?

  2. It's definitely better to use Google official Calendar API, as it's official, supported, future-proof and write-enabled. 绝对最好使用Google官方Calendar API,因为它是官方的,受支持的,面向未来的且支持写入功能。

The only downside to using Google Calendar API is that this is an online API and you need to have connectivity. 使用Google Calendar API的唯一缺点是,这是一个在线API,您需要连接。 You can work around this if you save the data and implement your own SyncAdapter . 如果保存数据并实现自己的SyncAdapter,则可以解决此问题。 Then your Calendar data will be synced when all other data on the device is synced. 然后,当设备上的所有其他数据都同步后,您的日历数据也将同步。

"as far as I know, there are ways to connect to the local calendar, but non of them are official ones, and it breaks in different versions of android." “据我所知,有多种方法可以连接到本地日历,但都不是官方的,并且会在不同版本的android中中断。”

This has been my experience as well. 这也是我的经验。 I would recommend using the internet Google Calendar API. 我建议使用互联网Google Calendar API。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM