Hi,

The Instances table is lazily populated. You don't see them if you are
looking via sqlite3. If you do a query via the ContentProvider
interface, you should see the instances for the events.

Thanks,
Mike


On Sat, Oct 20, 2012 at 12:54 AM, Bharat Parikh <[email protected]> wrote:
> Objective: To write a sync adapter that syncs Google calendar events with
> local android calendar (server to device - one way only).
>
> Android Version: Froyo
>
> Debugging Steps:
>
> A past non-recurring event (one month old) is read from Google Calendar
> I insert it locally in android calendar (calendar entry that I created)
> The event is inserted successfully in events table but the corresponding
> entry in instances table is not created
> I update the calendarmetadata table values to mininstance=0 and
> maxinstance="event's end date in millis" (on command prompt through sqlite3
> tool)
> I again try inserting the same event locally
> This time the event is inserted successfully in events table and the
> corresponding entry in instances table also gets created
>
> Looking at the CalendarProvider.java and Calendar.java source code and
> further probing revealed the following:
>
> After I insert a row in Calendars table, the mininstance is set to today's
> date and maxinstance is set to some 7 or 15 days in future so e.g. if today
> is 19-Oct, creating a calendar entry and accessing the calendar agenda
> activity sets mininstance=19-Oct (in millis) and maxinstance=26-Oct (in
> millis).
> In step # 3 above when the content provider inserts an event it looks at the
> mininstance and maxinstance values to expand and insert instances for the
> given event in instances table. Since the event start time lies before the
> mininstance value (since the event is one month old) the content provider
> doesn't create corresponding instances entry.
>
> Given that I cannot directly write to calendarmetadata and instances tables
> from my code how can I sync older events with my local calendar on android
> device for froyo version?
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to