I have followed the tutorial in this link - http://jimblackler.net/blog/?p=151&cpage=2#comment-52767 to access the internal android calendar database (even though it is not officially supported by the SDK). It works for all entries except for recurring events. The cursor does not return any recurring events at all. Can someone help me here. Following is my cursor declaration -
String[] projection = new String[] { "title", "description", "dtstart", "eventLocation" };
String selection = "(calendar_id=" + calID + ")AND " + (now - window)
+ "<dtstart AND dtstart< " + (now + (window));
String sortorder = "dtstart ASC";
Cursor managedCursor = getCalendarManagedCursor(projection, selection,
"events", sortorder);
private Cursor getCalendarManagedCursor(String[] projection,
String selection, String path, String sort) {
Uri calendars = Uri.parse("content://calendar/" + path);
Cursor managedCursor = null;
try {
managedCursor = getContentResolver().query(calendars, projection,
selection, null, sort);
} catch (IllegalArgumentException e) {
Log.w(DEBUG_TAG,
"Failed to get provider at [" + calendars.toString() + "]");
}
if (managedCursor == null) {
// try again
calendars = Uri.parse("content://com.android.calendar/" + path);
try {
managedCursor = getContentResolver().query(calendars,
projection, selection, null, sort);
} catch (IllegalArgumentException e) {
Log.w(DEBUG_TAG,
"Failed to get provider at [" + calendars.toString()
+ "]");
}`