Android 日历事件 - 识别事件的键
我有一个关于 Android 日历事件的问题。
如果某个事件从同一个日历(例如 Google 日历......)同步到 2 部不同的手机中,我可以使用什么键来识别该事件?
我正在为我的项目构建一个应用程序,到目前为止它可以创建、更新、删除应用程序生成的日历事件,但是,我用来识别它的方法是通过
在描述中搜索带有开始和结束的关键字时间。我认为这不是完美的解决方案,因为如果人们更改描述内容,可能会出现问题。
任何提示或技巧将不胜感激。
谢谢
I've a question regarding Android's Calendar event.
What key can I use to identify an event If it is sync-ed into 2 different phones from the same calendar (Google calendar for example..)?
I'm building an application for my project, so far it can create,update,delete a calendar event generated by the application, however, the method I use to identify it is by
searching for a keyword in the description with the start and end time. I figured this is not the perfect solution as problem may arise if people change the description content.
Any hint or tips will be appreciated.
Thank you
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Android 没有“日历事件”。 Android操作系统没有“日历”的标准化概念。
有多种适用于 Android 的日历应用程序。也许您正在考虑 Android 开源项目中的日历应用程序。但是,此应用程序没有记录且受支持的 API。如果您希望处理与此应用程序相关的活动,请使用 Google 日历 GData API。
如果您希望使用其他 Android 日历应用程序中的事件,请联系他们以了解他们是否提供 API。
Android does not have a "Calendar event". Android, the operating system, does not have a standardized concept of a "calendar".
There are several calendar applications available for Android. Perhaps you are thinking of the Calendar application from the Android open source project. However, this application has no documented and supported APIs. If you wish to work with events pertaining to this application, please use the Google Calendar GData API.
If you wish to work with events from some other calendar application for Android, contact them to see if they offer an API.
Calendar.java(某些版本)的源代码可以在 http://www.google.com/codesearch/p?hl=en&sa=N&cd=3&ct=rc# uX1GffpyOZk/core/java/android/provider/Calendar.java
也许您正在寻找“event_id”或“_sync_id”。我不是专家,但查看来源可能会帮助您找到所需的内容。
但正如大家常说的:使用私有 API 的风险由您(和您的用户)自行承担。
The source code for (some version of) Calendar.java can be found http://www.google.com/codesearch/p?hl=en&sa=N&cd=3&ct=rc#uX1GffpyOZk/core/java/android/provider/Calendar.java
Perhaps you're looking for "event_id" or "_sync_id". I'm no expert but looking at the source might help you find what you're looking for.
But as everyone always says: Use private APIs at your (and your users') own risk.