|
CalendarPickerAPI
Interface specification for OI Calendar Picker
IntroductionOI Calendar Picker is a utility to pick dates and events and visualize timeline-based information. It features:
User InstallationWhen launching the Calendar Picker Intent, one may check whether the matching Activity is found and prompt the user to install it if necessary (see demo code). One may either direct the user to the Android Market for the application package org.openintents.calendarpicker or offer a direct web download of the .apk from this list. Interface SpecificationContantsAll of the constants are available in the file CalendarPickerConstants.java. You may include this single file in your application to simplify code maintenance. Database columnsClients should implement a ContentProvider that supplies a list of events with mime-type of vnd.android.cursor.dir/event and columns as follows
In addition to these mandatory columns, you may supply auxiliary "quantity" columns, with column names specified in the Intent extras. Intent ExtrasInputOptional: A "calendar_id" to limit events from the ContentProvider to a particular calendar. Optional: org.openintents.calendarpicker.intent.extra.VISUALIZE_QUANTITIES -- A boolean to indicate whether the calendar days should be color mapped to a scale determined by the range of "quantity", aggregated for each day. Optionally, one may provide a starting date for the calendar to display. This should be an epoch value as documented below. Arbitrary quantities can be associated with events... OutputThe epoch is a long value representing the number of milliseconds since midnight on January 1, 1970 (See Unix time). The additional extra, datetime, is a hyphenated year-month-date String in ISO 8601 format. Both datetime and epoch shall represent the same time. Database TechniquesTo aggregate data per day within SQLite, you can create a VIEW with a truncated timestamp column. "CAST((CAST(" + MY_TIMESTAMP_COLUMN + "/" + MILLISECONDS_PER_DAY + " AS INTEGER)*" + MILLISECONDS_PER_DAY + ") AS INTEGER) " + CalendarPickerConstants.CalendarEventPicker.ContentProviderColumns.TIMESTAMPThis gives the same timestamp value to all events that fall on the same day. Then you can perform GROUP BY queries on the timestamp column to COUNT or SUM other quantities over all events in the day. Screenshots
| ||||||||||||||||||
Is it feasible to incorporate this widget directly into app, without resorting to inter-process communication?