Sunday, January 20, 2013

[android-developers] Re: Not working calendar events query.

The CalendarContract component is the only sane way to access a user's calendar data. Unfortunately it's only for API level 14 and higher ( >= 4.0). In older Android versions the calendar contentprovider is part of a hidden API which has been customized by various manufacturers. That means there is no official, standardized way of accessing or manipulating calendar data.

You could try accessing that hidden contentprovider the way you're doing it. But you need to guess the proper content URI. And you also need to make assumptions about the table column names and so on. It's not really a pretty nor reliable thing to do.

I had the same problem with one of my apps. For that reason I wrote my own calendar SyncAdapter and ContentProvider components that synchronize with the Google Calendar web API.

On Saturday, January 19, 2013 10:17:53 PM UTC-6, askl wrote:
Hello friends,
i want to get calendar events using this query.

Cursor cursor = getContentResolver().query(
Uri.parse("content://com.android.calendar/events"),
new String[] { "_id", "title", "dtstart", "dtend" }, null,
null, "dtstart ASC");

Manifest,xml
<uses-sdk
        android:minSdkVersion="8"
        android:targetSdkVersion="17" />

    <uses-permission android:name="android.permission.READ_CALENDAR" />
    <uses-permission android:name="android.permission.WRITE_CALENDAR" />

But ones generate an exception called null longparser dtend on android version 2.2.

just explain to me this query is working on which os version..? 
2.2 and up version or 3.0 and up version

or else this method is ok or not.

just help me..
thank you
askl



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

No comments:

Post a Comment