0
votes

I am now dealing with a problem how to sync some calendar's repetitive meetings with Google calendar repetitive meetings.

Which means when I create a repetitive meeting in the first calendar, all its recurrences will be paired to their corresponding recurrence in Google. (by keeping google id on them probably?) so when I change event in either calendar, the change will show up in the other one.

Is there any clear solution how to approach this? All I was able to came up with are these two:

1. Calculate google calendar IDs for each recurrence based on "parent google recurrence ID + timestamp."

I've noticed, that recurrences in google have id with this format, but I don't feel comfortable with this, since the ID format may change any time and there is not any mention in google documentation about this.

But this would be really clean, so maybe my guts are wrong and I can count with this.

2. In the beginning create recurring event in Google and then somehow pair the events based on time and name

I don't like this one either. It would mean, that I would have to ask through api for all recurrences, which would take probably a lot of time I don't want to waste.

Another flaw to this is that in very unlikely case, the user could be quick enough and change the event in google before the sync would reach it, thus breaking it.

Or maybe I could download all of users meetings and just loop in the array? Maybe there is some filter to get only recurrences of repetitive event in google I missed in doc?


Another thing is, that there are events "just" two years in the future in Google, so when I have a recurrence longer than that in the other calendar, I actually can't pair anything in far future.

There has to be something more into it, that I am missing, some easy and clean solution, please give me anything. Thanks.

1

1 Answers

0
votes

If you haven't done so, check Calendar Provider API which allows you to perform query, insert, update, and delete operations on calendars, events, attendees, reminders, and so on.

Using this API in recurring events, multiple rows are automatically generated in CalendarContract.Instances table that correspond to multiple occurrences of that event.

Then, for the synchronization part, a sync adapter synchronizes the calendar data on a user's device with another server or data source.