Please check here:
Calendar Provider | Android Developers
Sample codes for getting events
Cursor instance_cur = null;
//selection
String instance_selection =
"("+Instances.BEGIN+"<"+now+ ")"+
"and" + "("+Instances.END+">"+now+ ")" ;
String[] event_projection = new String[] {
Instances.TITLE, //0
Instances.CALENDAR_DISPLAY_NAME, //1
Instances.BEGIN, //2
Instances.END, //3
Instances.ALL_DAY, //4
Instances.EVENT_LOCATION,//5
};
//find events in a week
Uri.Builder builder = Instances.CONTENT_URI.buildUpon();
ContentUris.appendId(builder, now- DateUtils.WEEK_IN_MILLIS);
ContentUris.appendId(builder, now+ DateUtils.WEEK_IN_MILLIS);
try{
instance_cur = cr.query(builder.build(), event_projection, instance_selection, null, null);
while (instance_cur.moveToNext()) {
String title = instance_cur.getString(0);
String calendarName = instance_cur.getString(1);
Date beginTime = new Date(instance_cur.getLong(2));
Date endTime = new Date(instance_cur.getLong(3));
String eventLocation = instance_cur.getString(5);
}
}catch(Exception e)
{
}finally {
if( instance_cur != null && !instance_cur.isClosed() )
instance_cur.close();
}
}