Skip to content
hamsterksu edited this page Oct 23, 2014 · 1 revision

URI

Use @URI annotation to mark content path of entites, viewes or queries. Provider class will have a few methods to create content uri.

Important feature of the @URI - alternative notify uris. It's the list of uris which will be notified with content uri. So if we insert data to the Team table provider will notify ScoreView and ResultView uris too and UI refresh data.

@Table(TeamTable.TABLE_NAME)
public static interface TeamTable{
	
	String TABLE_NAME = "team_table";
	
	@URI(altNotify={ScoreView.CONTENT_PATH, ResultView.URI_CONTENT})
	String CONTENT_URI = "team_table";

Schema and Provider

Define SQL Schema

  1. Declare schema - @Schema
  2. Define sql table - @Table
  3. Define sql view - @SimpleView
  4. Define raw sql query - @RawQuery

Define Content Provider

  1. Declare provider - @Provider
  2. Define provider uri - @URI
  3. Extra provider features - features
Clone this wiki locally