Monday, June 6, 2011

EventIntent

Today a few modifications have been done to facilitate working with different sources.
  • EventsProvider has been added as a base class for all the providers. The aim is to handle URI matching in the base class, so derived providers only have to override the methods doing the actual queries. The existing two internal providers (Messaging, Telephony) are good examples how this concept could be applied.
  • New columns have been added to the SourcesProvider's SourcesTable:
    • description, 
    • icon_uri for an  image to be displayed in the settings as well as on the timeline,
    • authority of the associated provider,
    • and the event_intent field.
A few notes regarding the last one: EventIntent is the action string of an Intent to be fired if the user selects an event on the timeline. Every Event has an associated Source, and in case of the user clicks on an event, the applications simply checks what Source it came from, and fires the Intent defined by that Source. In order to identify the actual selected Event, the value of the _ID and the EVENT_KEY fields are passed as Intent extras.

No comments:

Post a Comment