Java Code Examples for android.content.UriMatcher

The following code examples are extracted from open source projects. You can click to vote up the examples that are useful to you.

Example 1

From project Airports, under directory /src/com/nadmm/airports/providers/.

Source file: AirportsProvider.java

  18 
vote

private static UriMatcher buildUriMatcher(){
  UriMatcher matcher=new UriMatcher(UriMatcher.NO_MATCH);
  matcher.addURI(AUTHORITY,"airport",SEARCH_AIRPORTS);
  matcher.addURI(AUTHORITY,"airport/*",GET_AIRPORT);
  matcher.addURI(AUTHORITY,SearchManager.SUGGEST_URI_PATH_QUERY,SEARCH_SUGGEST);
  matcher.addURI(AUTHORITY,SearchManager.SUGGEST_URI_PATH_QUERY + "/*",SEARCH_SUGGEST);
  return matcher;
}
 

Example 2

From project android-xbmcremote-sandbox, under directory /src/org/xbmc/android/jsonrpc/provider/.

Source file: AudioProvider.java

  18 
vote

/** 
 * Build and return a  {@link UriMatcher} that catches all {@link Uri}variations supported by this  {@link ContentProvider}.
 */
private static UriMatcher buildUriMatcher(){
  final UriMatcher matcher=new UriMatcher(UriMatcher.NO_MATCH);
  final String authority=AudioContract.CONTENT_AUTHORITY;
  matcher.addURI(authority,"albums",ALBUMS);
  matcher.addURI(authority,"albums/*",ALBUMS_ID);
  matcher.addURI(authority,"artists",ARTISTS);
  matcher.addURI(authority,"artists/*",ARTISTS_ID);
  matcher.addURI(authority,"artists/*/albums",ARTISTS_ID_ALBUMS);
  return matcher;
}
 

Example 3

From project android_packages_apps_Gallery3D, under directory /src/com/cooliris/picasa/.

Source file: TableContentProvider.java

  18 
vote

public void addMapping(String authority,String path,String mimeSubtype,EntrySchema table){
  ArrayList<Mapping> mappings=mMappings;
  UriMatcher matcher=mUriMatcher;
  matcher.addURI(authority,path,mappings.size());
  mappings.add(new Mapping(table,mimeSubtype,false));
  matcher.addURI(authority,path + "/#",mappings.size());
  mappings.add(new Mapping(table,mimeSubtype,true));
}
 

Example 4

From project android_packages_apps_QuickSearchBox, under directory /src/com/android/quicksearchbox/google/.

Source file: GoogleSuggestionProvider.java

  18 
vote

private UriMatcher buildUriMatcher(Context context){
  String authority=getAuthority(context);
  UriMatcher matcher=new UriMatcher(UriMatcher.NO_MATCH);
  matcher.addURI(authority,SearchManager.SUGGEST_URI_PATH_QUERY,SEARCH_SUGGEST);
  matcher.addURI(authority,SearchManager.SUGGEST_URI_PATH_QUERY + "/*",SEARCH_SUGGEST);
  matcher.addURI(authority,SearchManager.SUGGEST_URI_PATH_SHORTCUT,SEARCH_SHORTCUT);
  matcher.addURI(authority,SearchManager.SUGGEST_URI_PATH_SHORTCUT + "/*",SEARCH_SHORTCUT);
  return matcher;
}
 

Example 5

From project be.norio.twunch.android, under directory /src/be/norio/twunch/android/provider/.

Source file: TwunchProvider.java

  18 
vote

/** 
 * Build and return a  {@link UriMatcher} that catches all {@link Uri}variations supported by this  {@link ContentProvider}.
 */
private static UriMatcher buildUriMatcher(){
  final UriMatcher matcher=new UriMatcher(UriMatcher.NO_MATCH);
  final String authority=TwunchContract.CONTENT_AUTHORITY;
  matcher.addURI(authority,"twunches",TWUNCHES);
  matcher.addURI(authority,"twunches/future",TWUNCHES_FUTURE);
  matcher.addURI(authority,"twunches/*",TWUNCHES_ID);
  return matcher;
}
 

Example 6

From project danbooru-gallery-android, under directory /src/tw/idv/palatis/danboorugallery/.

Source file: TagProvider.java

  18 
vote

/** 
 * Builds up a UriMatcher for search suggestion and shortcut refresh queries.
 */
private static UriMatcher buildUriMatcher(){
  UriMatcher matcher=new UriMatcher(UriMatcher.NO_MATCH);
  matcher.addURI(AUTHORITY,"tag",SEARCH_TAG);
  matcher.addURI(AUTHORITY,"tag/#",GET_TAG);
  matcher.addURI(AUTHORITY,SearchManager.SUGGEST_URI_PATH_QUERY,SEARCH_SUGGEST);
  matcher.addURI(AUTHORITY,SearchManager.SUGGEST_URI_PATH_QUERY + "/*",SEARCH_SUGGEST);
  matcher.addURI(AUTHORITY,SearchManager.SUGGEST_URI_PATH_SHORTCUT,REFRESH_SHORTCUT);
  matcher.addURI(AUTHORITY,SearchManager.SUGGEST_URI_PATH_SHORTCUT + "/*",REFRESH_SHORTCUT);
  return matcher;
}
 

Example 7

From project ElectricSleep, under directory /src/com/androsz/electricsleepbeta/db/.

Source file: ElectricSleepProvider.java

  18 
vote

private static UriMatcher buildUriMatcher(){
  final UriMatcher matcher=new UriMatcher(UriMatcher.NO_MATCH);
  final String authority=CONTENT_AUTHORITY;
  matcher.addURI(authority,SleepSession.PATH,SLEEP_SESSIONS);
  matcher.addURI(authority,SleepSession.PATH + "/#",SLEEP_SESSIONS_ID);
  return matcher;
}
 

Example 8

From project NotePad, under directory /NotePad/src/org/openintents/notepad/search/.

Source file: SearchSuggestionProvider.java

  18 
vote

/** 
 * Sets up a uri matcher for search suggestion and shortcut refresh queries.
 */
private static UriMatcher buildUriMatcher(){
  UriMatcher matcher=new UriMatcher(UriMatcher.NO_MATCH);
  matcher.addURI(AUTHORITY,SearchManager.SUGGEST_URI_PATH_QUERY,SEARCH_SUGGEST);
  matcher.addURI(AUTHORITY,SearchManager.SUGGEST_URI_PATH_QUERY + "/*",SEARCH_SUGGEST);
  matcher.addURI(AUTHORITY,SearchManager.SUGGEST_URI_PATH_SHORTCUT,SHORTCUT_REFRESH);
  matcher.addURI(AUTHORITY,SearchManager.SUGGEST_URI_PATH_SHORTCUT + "/*",SHORTCUT_REFRESH);
  return matcher;
}
 

Example 9

From project OpenBike, under directory /src/fr/openbike/android/database/.

Source file: StationsProvider.java

  18 
vote

/** 
 * Builds up a UriMatcher for search suggestion and shortcut refresh queries.
 */
private static UriMatcher buildUriMatcher(){
  UriMatcher matcher=new UriMatcher(UriMatcher.NO_MATCH);
  matcher.addURI(AUTHORITY,"station/#",GET_STATION);
  matcher.addURI(AUTHORITY,SearchManager.SUGGEST_URI_PATH_QUERY,SEARCH_SUGGEST);
  matcher.addURI(AUTHORITY,SearchManager.SUGGEST_URI_PATH_QUERY + "/*",SEARCH_SUGGEST);
  return matcher;
}
 

Example 10

From project SVQCOM, under directory /Core/src/com/ushahidi/android/app/data/.

Source file: DeploymentProvider.java

  18 
vote

/** 
 * Builds up a UriMatcher for search suggestion and shortcut refresh queries.
 */
private UriMatcher buildUriMatcher(){
  UriMatcher matcher=new UriMatcher(UriMatcher.NO_MATCH);
  matcher.addURI(AUTHORITY,"deployment",SEARCH_DEPLOYMENTS);
  matcher.addURI(AUTHORITY,"deployment/#",GET_DEPLOYMENT);
  matcher.addURI(AUTHORITY,SearchManager.SUGGEST_URI_PATH_QUERY,SEARCH_SUGGEST);
  matcher.addURI(AUTHORITY,SearchManager.SUGGEST_URI_PATH_QUERY + "/*",SEARCH_SUGGEST);
  matcher.addURI(AUTHORITY,SearchManager.SUGGEST_URI_PATH_SHORTCUT,REFRESH_SHORTCUT);
  matcher.addURI(AUTHORITY,SearchManager.SUGGEST_URI_PATH_SHORTCUT + "/*",REFRESH_SHORTCUT);
  return matcher;
}
 

Example 11

From project tramhunter, under directory /android/TramHunter/src/com/andybotting/tramhunter/dao/.

Source file: TramHunterProvider.java

  18 
vote

private static UriMatcher buildUriMatcher(){
  UriMatcher matcher=new UriMatcher(UriMatcher.NO_MATCH);
  matcher.addURI(AUTHORITY,SearchManager.SUGGEST_URI_PATH_QUERY,SEARCH_SUGGEST);
  matcher.addURI(AUTHORITY,SearchManager.SUGGEST_URI_PATH_QUERY + "/*",SEARCH_SUGGEST);
  return matcher;
}
 

Example 12

From project XTrade, under directory /src/com/xtrade/android/provider/.

Source file: XTradeProvider.java

  18 
vote

public static UriMatcher buildMatcher(){
  final UriMatcher matcher=new UriMatcher(UriMatcher.NO_MATCH);
  final String CONTENT_AUTHORITY=DatabaseContract.CONTENT_AUTHORITY;
  matcher.addURI(CONTENT_AUTHORITY,DatabaseContract.PATH_TRADER,TRADER);
  matcher.addURI(CONTENT_AUTHORITY,DatabaseContract.PATH_TRADER + "/*",TRADER_ID);
  matcher.addURI(CONTENT_AUTHORITY,DatabaseContract.PATH_CONTACT,CONTACT);
  matcher.addURI(CONTENT_AUTHORITY,DatabaseContract.PATH_CONTACT + "/*",CONTACT_ID);
  matcher.addURI(CONTENT_AUTHORITY,DatabaseContract.PATH_CONTACT_TYPE,CONTACT_TYPE);
  matcher.addURI(CONTENT_AUTHORITY,DatabaseContract.PATH_CONTACT_TYPE + "/*",CONTACT_TYPE_ID);
  return matcher;
}
 

Example 13

From project ActionBarSherlock, under directory /samples/fragments/src/com/actionbarsherlock/sample/fragments/.

Source file: LoaderThrottleSupport.java

  17 
vote

/** 
 * Global provider initialization.
 */
public SimpleProvider(){
  mUriMatcher=new UriMatcher(UriMatcher.NO_MATCH);
  mUriMatcher.addURI(AUTHORITY,MainTable.TABLE_NAME,MAIN);
  mUriMatcher.addURI(AUTHORITY,MainTable.TABLE_NAME + "/#",MAIN_ID);
  mNotesProjectionMap=new HashMap<String,String>();
  mNotesProjectionMap.put(MainTable._ID,MainTable._ID);
  mNotesProjectionMap.put(MainTable.COLUMN_NAME_DATA,MainTable.COLUMN_NAME_DATA);
}
 

Example 14

From project androidTileMapEditor_1, under directory /src/it/sineo/android/tileMapEditor/.

Source file: TileMapContentProvider.java

  17 
vote

@Override public boolean onCreate(){
  uriMatcher=new UriMatcher(UriMatcher.NO_MATCH);
  uriMatcher.addURI(C.AUTHORITY_MAP,C.CONTENT_MAP_BASE,C.MATCH_MAPS);
  uriMatcher.addURI(C.AUTHORITY_MAP,C.CONTENT_MAP_BASE + "/#",C.MATCH_MAP_ID);
  dbHelper=new DatabaseHelper(getContext());
  return true;
}
 

Example 15

From project AquaNotesTest, under directory /src/com/google/android/apps/iosched/provider/.

Source file: ScheduleProvider.java

  17 
vote

/** 
 * Build and return a  {@link UriMatcher} that catches all {@link Uri}variations supported by this  {@link ContentProvider}.
 */
private static UriMatcher buildUriMatcher(){
  final UriMatcher matcher=new UriMatcher(UriMatcher.NO_MATCH);
  final String authority=ScheduleContract.CONTENT_AUTHORITY;
  matcher.addURI(authority,"blocks",BLOCKS);
  matcher.addURI(authority,"blocks/between/*/*",BLOCKS_BETWEEN);
  matcher.addURI(authority,"blocks/*",BLOCKS_ID);
  matcher.addURI(authority,"blocks/*/sessions",BLOCKS_ID_SESSIONS);
  matcher.addURI(authority,"tracks",TRACKS);
  matcher.addURI(authority,"tracks/*",TRACKS_ID);
  matcher.addURI(authority,"tracks/*/sessions",TRACKS_ID_SESSIONS);
  matcher.addURI(authority,"tracks/*/vendors",TRACKS_ID_VENDORS);
  matcher.addURI(authority,"rooms",ROOMS);
  matcher.addURI(authority,"rooms/*",ROOMS_ID);
  matcher.addURI(authority,"rooms/*/sessions",ROOMS_ID_SESSIONS);
  matcher.addURI(authority,"sessions",SESSIONS);
  matcher.addURI(authority,"sessions/starred",SESSIONS_STARRED);
  matcher.addURI(authority,"sessions/search/*",SESSIONS_SEARCH);
  matcher.addURI(authority,"sessions/at/*",SESSIONS_AT);
  matcher.addURI(authority,"sessions/*",SESSIONS_ID);
  matcher.addURI(authority,"sessions/*/speakers",SESSIONS_ID_SPEAKERS);
  matcher.addURI(authority,"sessions/*/tracks",SESSIONS_ID_TRACKS);
  matcher.addURI(authority,"speakers",SPEAKERS);
  matcher.addURI(authority,"speakers/*",SPEAKERS_ID);
  matcher.addURI(authority,"speakers/*/sessions",SPEAKERS_ID_SESSIONS);
  matcher.addURI(authority,"vendors",VENDORS);
  matcher.addURI(authority,"vendors/starred",VENDORS_STARRED);
  matcher.addURI(authority,"vendors/search/*",VENDORS_SEARCH);
  matcher.addURI(authority,"vendors/*",VENDORS_ID);
  matcher.addURI(authority,"search_suggest_query",SEARCH_SUGGEST);
  return matcher;
}
 

Example 16

From project conference-mobile-app, under directory /android-app/src/com/google/android/apps/iosched/provider/.

Source file: ScheduleProvider.java

  17 
vote

/** 
 * Build and return a  {@link UriMatcher} that catches all {@link Uri}variations supported by this  {@link ContentProvider}.
 */
private static UriMatcher buildUriMatcher(){
  final UriMatcher matcher=new UriMatcher(UriMatcher.NO_MATCH);
  final String authority=ScheduleContract.CONTENT_AUTHORITY;
  matcher.addURI(authority,"blocks",BLOCKS);
  matcher.addURI(authority,"blocks/between/*/*",BLOCKS_BETWEEN);
  matcher.addURI(authority,"blocks/*",BLOCKS_ID);
  matcher.addURI(authority,"blocks/*/sessions",BLOCKS_ID_SESSIONS);
  matcher.addURI(authority,"tracks",TRACKS);
  matcher.addURI(authority,"tracks/*",TRACKS_ID);
  matcher.addURI(authority,"tracks/*/sessions",TRACKS_ID_SESSIONS);
  matcher.addURI(authority,"tracks/*/vendors",TRACKS_ID_VENDORS);
  matcher.addURI(authority,"rooms",ROOMS);
  matcher.addURI(authority,"rooms/*",ROOMS_ID);
  matcher.addURI(authority,"rooms/*/sessions",ROOMS_ID_SESSIONS);
  matcher.addURI(authority,"sessions",SESSIONS);
  matcher.addURI(authority,"sessions/starred",SESSIONS_STARRED);
  matcher.addURI(authority,"sessions/search/*",SESSIONS_SEARCH);
  matcher.addURI(authority,"sessions/at/*",SESSIONS_AT);
  matcher.addURI(authority,"sessions/*",SESSIONS_ID);
  matcher.addURI(authority,"sessions/*/speakers",SESSIONS_ID_SPEAKERS);
  matcher.addURI(authority,"sessions/*/tracks",SESSIONS_ID_TRACKS);
  matcher.addURI(authority,"speakers",SPEAKERS);
  matcher.addURI(authority,"speakers/*",SPEAKERS_ID);
  matcher.addURI(authority,"speakers/*/sessions",SPEAKERS_ID_SESSIONS);
  matcher.addURI(authority,"vendors",VENDORS);
  matcher.addURI(authority,"vendors/starred",VENDORS_STARRED);
  matcher.addURI(authority,"vendors/search/*",VENDORS_SEARCH);
  matcher.addURI(authority,"vendors/*",VENDORS_ID);
  matcher.addURI(authority,"search_suggest_query",SEARCH_SUGGEST);
  return matcher;
}
 

Example 17

From project dccsched, under directory /src/com/underhilllabs/dccsched/provider/.

Source file: ScheduleProvider.java

  17 
vote

/** 
 * Build and return a  {@link UriMatcher} that catches all {@link Uri}variations supported by this  {@link ContentProvider}.
 */
private static UriMatcher buildUriMatcher(){
  final UriMatcher matcher=new UriMatcher(UriMatcher.NO_MATCH);
  final String authority=ScheduleContract.CONTENT_AUTHORITY;
  matcher.addURI(authority,"blocks",BLOCKS);
  matcher.addURI(authority,"blocks/between/*/*",BLOCKS_BETWEEN);
  matcher.addURI(authority,"blocks/*",BLOCKS_ID);
  matcher.addURI(authority,"blocks/*/sessions",BLOCKS_ID_SESSIONS);
  matcher.addURI(authority,"tracks",TRACKS);
  matcher.addURI(authority,"tracks/*",TRACKS_ID);
  matcher.addURI(authority,"tracks/*/sessions",TRACKS_ID_SESSIONS);
  matcher.addURI(authority,"tracks/*/vendors",TRACKS_ID_VENDORS);
  matcher.addURI(authority,"rooms",ROOMS);
  matcher.addURI(authority,"rooms/*",ROOMS_ID);
  matcher.addURI(authority,"rooms/*/sessions",ROOMS_ID_SESSIONS);
  matcher.addURI(authority,"sessions",SESSIONS);
  matcher.addURI(authority,"sessions/starred",SESSIONS_STARRED);
  matcher.addURI(authority,"sessions/search/*",SESSIONS_SEARCH);
  matcher.addURI(authority,"sessions/at/*",SESSIONS_AT);
  matcher.addURI(authority,"sessions/*",SESSIONS_ID);
  matcher.addURI(authority,"sessions/*/speakers",SESSIONS_ID_SPEAKERS);
  matcher.addURI(authority,"sessions/*/tracks",SESSIONS_ID_TRACKS);
  matcher.addURI(authority,"sessions/*/notes",SESSIONS_ID_NOTES);
  matcher.addURI(authority,"speakers",SPEAKERS);
  matcher.addURI(authority,"speakers/*",SPEAKERS_ID);
  matcher.addURI(authority,"speakers/*/sessions",SPEAKERS_ID_SESSIONS);
  matcher.addURI(authority,"vendors",VENDORS);
  matcher.addURI(authority,"vendors/starred",VENDORS_STARRED);
  matcher.addURI(authority,"vendors/search/*",VENDORS_SEARCH);
  matcher.addURI(authority,"vendors/*",VENDORS_ID);
  matcher.addURI(authority,"notes",NOTES);
  matcher.addURI(authority,"notes/export",NOTES_EXPORT);
  matcher.addURI(authority,"notes/*",NOTES_ID);
  matcher.addURI(authority,"search_suggest_query",SEARCH_SUGGEST);
  return matcher;
}
 

Example 18

From project dcnyc10-android, under directory /android/src/com/lullabot/android/apps/iosched/provider/.

Source file: ScheduleProvider.java

  17 
vote

/** 
 * Build and return a  {@link UriMatcher} that catches all {@link Uri}variations supported by this  {@link ContentProvider}.
 */
private static UriMatcher buildUriMatcher(){
  final UriMatcher matcher=new UriMatcher(UriMatcher.NO_MATCH);
  final String authority=ScheduleContract.CONTENT_AUTHORITY;
  matcher.addURI(authority,"blocks",BLOCKS);
  matcher.addURI(authority,"blocks/between/*/*",BLOCKS_BETWEEN);
  matcher.addURI(authority,"blocks/*",BLOCKS_ID);
  matcher.addURI(authority,"blocks/*/sessions",BLOCKS_ID_SESSIONS);
  matcher.addURI(authority,"tracks",TRACKS);
  matcher.addURI(authority,"tracks/*",TRACKS_ID);
  matcher.addURI(authority,"tracks/*/sessions",TRACKS_ID_SESSIONS);
  matcher.addURI(authority,"tracks/*/vendors",TRACKS_ID_VENDORS);
  matcher.addURI(authority,"rooms",ROOMS);
  matcher.addURI(authority,"rooms/*",ROOMS_ID);
  matcher.addURI(authority,"rooms/*/sessions",ROOMS_ID_SESSIONS);
  matcher.addURI(authority,"sessions",SESSIONS);
  matcher.addURI(authority,"sessions/starred",SESSIONS_STARRED);
  matcher.addURI(authority,"sessions/search/*",SESSIONS_SEARCH);
  matcher.addURI(authority,"sessions/at/*",SESSIONS_AT);
  matcher.addURI(authority,"sessions/*",SESSIONS_ID);
  matcher.addURI(authority,"sessions/*/speakers",SESSIONS_ID_SPEAKERS);
  matcher.addURI(authority,"sessions/*/tracks",SESSIONS_ID_TRACKS);
  matcher.addURI(authority,"speakers",SPEAKERS);
  matcher.addURI(authority,"speakers/*",SPEAKERS_ID);
  matcher.addURI(authority,"speakers/*/sessions",SPEAKERS_ID_SESSIONS);
  matcher.addURI(authority,"vendors",VENDORS);
  matcher.addURI(authority,"vendors/starred",VENDORS_STARRED);
  matcher.addURI(authority,"vendors/search/*",VENDORS_SEARCH);
  matcher.addURI(authority,"vendors/*",VENDORS_ID);
  matcher.addURI(authority,"search_suggest_query",SEARCH_SUGGEST);
  return matcher;
}
 

Example 19

From project DeliciousDroid, under directory /src/com/deliciousdroid/providers/.

Source file: BookmarkContentProvider.java

  17 
vote

private static UriMatcher buildUriMatcher(){
  UriMatcher matcher=new UriMatcher(UriMatcher.NO_MATCH);
  matcher.addURI(AUTHORITY,"bookmark",Bookmarks);
  matcher.addURI(AUTHORITY,"tag",Tags);
  matcher.addURI(AUTHORITY,"bundle",Bundles);
  matcher.addURI(AUTHORITY,"main/" + SearchManager.SUGGEST_URI_PATH_QUERY,SearchSuggest);
  matcher.addURI(AUTHORITY,"main/" + SearchManager.SUGGEST_URI_PATH_QUERY + "/*",SearchSuggest);
  matcher.addURI(AUTHORITY,"tag/" + SearchManager.SUGGEST_URI_PATH_QUERY,TagSearchSuggest);
  matcher.addURI(AUTHORITY,"tag/" + SearchManager.SUGGEST_URI_PATH_QUERY + "/*",TagSearchSuggest);
  matcher.addURI(AUTHORITY,"bookmark/" + SearchManager.SUGGEST_URI_PATH_QUERY,BookmarkSearchSuggest);
  matcher.addURI(AUTHORITY,"bookmark/" + SearchManager.SUGGEST_URI_PATH_QUERY + "/*",BookmarkSearchSuggest);
  matcher.addURI(AUTHORITY,"tag/livefolder",TagLiveFolder);
  matcher.addURI(AUTHORITY,"bookmark/livefolder",BookmarkLiveFolder);
  return matcher;
}
 

Example 20

From project devoxx-france-android-in-fine, under directory /src/com/infine/android/devoxx/provider/.

Source file: ScheduleProvider.java

  17 
vote

/** 
 * Build and return a  {@link UriMatcher} that catches all {@link Uri}variations supported by this  {@link ContentProvider}.
 */
private static UriMatcher buildUriMatcher(){
  final UriMatcher matcher=new UriMatcher(UriMatcher.NO_MATCH);
  final String authority=ScheduleContract.CONTENT_AUTHORITY;
  matcher.addURI(authority,"blocks",BLOCKS);
  matcher.addURI(authority,"blocks/between/*/*",BLOCKS_BETWEEN);
  matcher.addURI(authority,"blocks/*",BLOCKS_ID);
  matcher.addURI(authority,"blocks/*/sessions",BLOCKS_ID_SESSIONS);
  matcher.addURI(authority,"tweets",TWEETS);
  matcher.addURI(authority,"rooms",ROOMS);
  matcher.addURI(authority,"rooms/*",ROOMS_ID);
  matcher.addURI(authority,"rooms/*/sessions",ROOMS_ID_SESSIONS);
  matcher.addURI(authority,"sessions",SESSIONS);
  matcher.addURI(authority,"sessions/starred",SESSIONS_STARRED);
  matcher.addURI(authority,"sessions/search/*",SESSIONS_SEARCH);
  matcher.addURI(authority,"sessions/at/*",SESSIONS_AT);
  matcher.addURI(authority,"sessions/*",SESSIONS_ID);
  matcher.addURI(authority,"speakers",SPEAKERS);
  matcher.addURI(authority,"speakers/search/*",SPEAKERS_SEARCH);
  matcher.addURI(authority,"speakers/*",SPEAKERS_ID);
  matcher.addURI(authority,"search_suggest_query",SEARCH_SUGGEST);
  return matcher;
}
 

Example 21

From project finch, under directory /libs/JakeWharton-ActionBarSherlock-2eabf25/samples/fragments/src/com/actionbarsherlock/sample/fragments/.

Source file: LoaderThrottleSupport.java

  17 
vote

/** 
 * Global provider initialization.
 */
public SimpleProvider(){
  mUriMatcher=new UriMatcher(UriMatcher.NO_MATCH);
  mUriMatcher.addURI(AUTHORITY,MainTable.TABLE_NAME,MAIN);
  mUriMatcher.addURI(AUTHORITY,MainTable.TABLE_NAME + "/#",MAIN_ID);
  mNotesProjectionMap=new HashMap<String,String>();
  mNotesProjectionMap.put(MainTable._ID,MainTable._ID);
  mNotesProjectionMap.put(MainTable.COLUMN_NAME_DATA,MainTable.COLUMN_NAME_DATA);
}
 

Example 22

From project gddsched2, under directory /trunk/android/src/com/google/android/apps/iosched2/provider/.

Source file: ScheduleProvider.java

  17 
vote

/** 
 * Build and return a  {@link UriMatcher} that catches all {@link Uri}variations supported by this  {@link ContentProvider}.
 */
private static UriMatcher buildUriMatcher(){
  final UriMatcher matcher=new UriMatcher(UriMatcher.NO_MATCH);
  final String authority=ScheduleContract.CONTENT_AUTHORITY;
  matcher.addURI(authority,"blocks",BLOCKS);
  matcher.addURI(authority,"blocks/between/*/*",BLOCKS_BETWEEN);
  matcher.addURI(authority,"blocks/*",BLOCKS_ID);
  matcher.addURI(authority,"blocks/*/sessions",BLOCKS_ID_SESSIONS);
  matcher.addURI(authority,"tracks",TRACKS);
  matcher.addURI(authority,"tracks/*",TRACKS_ID);
  matcher.addURI(authority,"tracks/*/sessions",TRACKS_ID_SESSIONS);
  matcher.addURI(authority,"tracks/*/vendors",TRACKS_ID_VENDORS);
  matcher.addURI(authority,"rooms",ROOMS);
  matcher.addURI(authority,"rooms/*",ROOMS_ID);
  matcher.addURI(authority,"rooms/*/sessions",ROOMS_ID_SESSIONS);
  matcher.addURI(authority,"sessions",SESSIONS);
  matcher.addURI(authority,"sessions/starred",SESSIONS_STARRED);
  matcher.addURI(authority,"sessions/search/*",SESSIONS_SEARCH);
  matcher.addURI(authority,"sessions/at/*",SESSIONS_AT);
  matcher.addURI(authority,"sessions/*",SESSIONS_ID);
  matcher.addURI(authority,"sessions/*/speakers",SESSIONS_ID_SPEAKERS);
  matcher.addURI(authority,"sessions/*/tracks",SESSIONS_ID_TRACKS);
  matcher.addURI(authority,"speakers",SPEAKERS);
  matcher.addURI(authority,"speakers/*",SPEAKERS_ID);
  matcher.addURI(authority,"speakers/*/sessions",SPEAKERS_ID_SESSIONS);
  matcher.addURI(authority,"vendors",VENDORS);
  matcher.addURI(authority,"vendors/starred",VENDORS_STARRED);
  matcher.addURI(authority,"vendors/search/*",VENDORS_SEARCH);
  matcher.addURI(authority,"vendors/*",VENDORS_ID);
  matcher.addURI(authority,"search_suggest_query",SEARCH_SUGGEST);
  return matcher;
}
 

Example 23

From project iosched, under directory /android/src/com/google/android/apps/iosched/provider/.

Source file: ScheduleProvider.java

  17 
vote

/** 
 * Build and return a  {@link UriMatcher} that catches all {@link Uri}variations supported by this  {@link ContentProvider}.
 */
private static UriMatcher buildUriMatcher(){
  final UriMatcher matcher=new UriMatcher(UriMatcher.NO_MATCH);
  final String authority=ScheduleContract.CONTENT_AUTHORITY;
  matcher.addURI(authority,"blocks",BLOCKS);
  matcher.addURI(authority,"blocks/between/*/*",BLOCKS_BETWEEN);
  matcher.addURI(authority,"blocks/*",BLOCKS_ID);
  matcher.addURI(authority,"blocks/*/sessions",BLOCKS_ID_SESSIONS);
  matcher.addURI(authority,"tracks",TRACKS);
  matcher.addURI(authority,"tracks/*",TRACKS_ID);
  matcher.addURI(authority,"tracks/*/sessions",TRACKS_ID_SESSIONS);
  matcher.addURI(authority,"tracks/*/vendors",TRACKS_ID_VENDORS);
  matcher.addURI(authority,"rooms",ROOMS);
  matcher.addURI(authority,"rooms/*",ROOMS_ID);
  matcher.addURI(authority,"rooms/*/sessions",ROOMS_ID_SESSIONS);
  matcher.addURI(authority,"sessions",SESSIONS);
  matcher.addURI(authority,"sessions/starred",SESSIONS_STARRED);
  matcher.addURI(authority,"sessions/search/*",SESSIONS_SEARCH);
  matcher.addURI(authority,"sessions/at/*",SESSIONS_AT);
  matcher.addURI(authority,"sessions/*",SESSIONS_ID);
  matcher.addURI(authority,"sessions/*/speakers",SESSIONS_ID_SPEAKERS);
  matcher.addURI(authority,"sessions/*/tracks",SESSIONS_ID_TRACKS);
  matcher.addURI(authority,"speakers",SPEAKERS);
  matcher.addURI(authority,"speakers/*",SPEAKERS_ID);
  matcher.addURI(authority,"speakers/*/sessions",SPEAKERS_ID_SESSIONS);
  matcher.addURI(authority,"vendors",VENDORS);
  matcher.addURI(authority,"vendors/starred",VENDORS_STARRED);
  matcher.addURI(authority,"vendors/search/*",VENDORS_SEARCH);
  matcher.addURI(authority,"vendors/*",VENDORS_ID);
  matcher.addURI(authority,"search_suggest_query",SEARCH_SUGGEST);
  return matcher;
}
 

Example 24

From project iosched2011, under directory /android/src/com/google/android/apps/iosched/provider/.

Source file: ScheduleProvider.java

  17 
vote

/** 
 * Build and return a  {@link UriMatcher} that catches all {@link Uri}variations supported by this  {@link ContentProvider}.
 */
private static UriMatcher buildUriMatcher(){
  final UriMatcher matcher=new UriMatcher(UriMatcher.NO_MATCH);
  final String authority=ScheduleContract.CONTENT_AUTHORITY;
  matcher.addURI(authority,"blocks",BLOCKS);
  matcher.addURI(authority,"blocks/between/*/*",BLOCKS_BETWEEN);
  matcher.addURI(authority,"blocks/*",BLOCKS_ID);
  matcher.addURI(authority,"blocks/*/sessions",BLOCKS_ID_SESSIONS);
  matcher.addURI(authority,"tracks",TRACKS);
  matcher.addURI(authority,"tracks/*",TRACKS_ID);
  matcher.addURI(authority,"tracks/*/sessions",TRACKS_ID_SESSIONS);
  matcher.addURI(authority,"tracks/*/vendors",TRACKS_ID_VENDORS);
  matcher.addURI(authority,"rooms",ROOMS);
  matcher.addURI(authority,"rooms/*",ROOMS_ID);
  matcher.addURI(authority,"rooms/*/sessions",ROOMS_ID_SESSIONS);
  matcher.addURI(authority,"sessions",SESSIONS);
  matcher.addURI(authority,"sessions/starred",SESSIONS_STARRED);
  matcher.addURI(authority,"sessions/search/*",SESSIONS_SEARCH);
  matcher.addURI(authority,"sessions/at/*",SESSIONS_AT);
  matcher.addURI(authority,"sessions/*",SESSIONS_ID);
  matcher.addURI(authority,"sessions/*/speakers",SESSIONS_ID_SPEAKERS);
  matcher.addURI(authority,"sessions/*/tracks",SESSIONS_ID_TRACKS);
  matcher.addURI(authority,"speakers",SPEAKERS);
  matcher.addURI(authority,"speakers/*",SPEAKERS_ID);
  matcher.addURI(authority,"speakers/*/sessions",SPEAKERS_ID_SESSIONS);
  matcher.addURI(authority,"vendors",VENDORS);
  matcher.addURI(authority,"vendors/starred",VENDORS_STARRED);
  matcher.addURI(authority,"vendors/search/*",VENDORS_SEARCH);
  matcher.addURI(authority,"vendors/*",VENDORS_ID);
  matcher.addURI(authority,"search_suggest_query",SEARCH_SUGGEST);
  return matcher;
}
 

Example 25

From project iosched_1, under directory /src/com/google/android/apps/iosched/provider/.

Source file: ScheduleProvider.java

  17 
vote

/** 
 * Build and return a  {@link UriMatcher} that catches all {@link Uri}variations supported by this  {@link ContentProvider}.
 */
private static UriMatcher buildUriMatcher(){
  final UriMatcher matcher=new UriMatcher(UriMatcher.NO_MATCH);
  final String authority=ScheduleContract.CONTENT_AUTHORITY;
  matcher.addURI(authority,"blocks",BLOCKS);
  matcher.addURI(authority,"blocks/between/*/*",BLOCKS_BETWEEN);
  matcher.addURI(authority,"blocks/*",BLOCKS_ID);
  matcher.addURI(authority,"blocks/*/sessions",BLOCKS_ID_SESSIONS);
  matcher.addURI(authority,"tracks",TRACKS);
  matcher.addURI(authority,"tracks/*",TRACKS_ID);
  matcher.addURI(authority,"tracks/*/sessions",TRACKS_ID_SESSIONS);
  matcher.addURI(authority,"tracks/*/vendors",TRACKS_ID_VENDORS);
  matcher.addURI(authority,"rooms",ROOMS);
  matcher.addURI(authority,"rooms/*",ROOMS_ID);
  matcher.addURI(authority,"rooms/*/sessions",ROOMS_ID_SESSIONS);
  matcher.addURI(authority,"sessions",SESSIONS);
  matcher.addURI(authority,"sessions/starred",SESSIONS_STARRED);
  matcher.addURI(authority,"sessions/search/*",SESSIONS_SEARCH);
  matcher.addURI(authority,"sessions/at/*",SESSIONS_AT);
  matcher.addURI(authority,"sessions/*",SESSIONS_ID);
  matcher.addURI(authority,"sessions/*/speakers",SESSIONS_ID_SPEAKERS);
  matcher.addURI(authority,"sessions/*/tracks",SESSIONS_ID_TRACKS);
  matcher.addURI(authority,"sessions/*/notes",SESSIONS_ID_NOTES);
  matcher.addURI(authority,"speakers",SPEAKERS);
  matcher.addURI(authority,"speakers/*",SPEAKERS_ID);
  matcher.addURI(authority,"speakers/*/sessions",SPEAKERS_ID_SESSIONS);
  matcher.addURI(authority,"vendors",VENDORS);
  matcher.addURI(authority,"vendors/starred",VENDORS_STARRED);
  matcher.addURI(authority,"vendors/search/*",VENDORS_SEARCH);
  matcher.addURI(authority,"vendors/*",VENDORS_ID);
  matcher.addURI(authority,"notes",NOTES);
  matcher.addURI(authority,"notes/export",NOTES_EXPORT);
  matcher.addURI(authority,"notes/*",NOTES_ID);
  matcher.addURI(authority,"search_suggest_query",SEARCH_SUGGEST);
  return matcher;
}
 

Example 26

From project iosched_2, under directory /android/src/com/google/android/apps/iosched/provider/.

Source file: ScheduleProvider.java

  17 
vote

/** 
 * Build and return a  {@link UriMatcher} that catches all {@link Uri}variations supported by this  {@link ContentProvider}.
 */
private static UriMatcher buildUriMatcher(){
  final UriMatcher matcher=new UriMatcher(UriMatcher.NO_MATCH);
  final String authority=ScheduleContract.CONTENT_AUTHORITY;
  matcher.addURI(authority,"blocks",BLOCKS);
  matcher.addURI(authority,"blocks/between/*/*",BLOCKS_BETWEEN);
  matcher.addURI(authority,"blocks/*",BLOCKS_ID);
  matcher.addURI(authority,"blocks/*/sessions",BLOCKS_ID_SESSIONS);
  matcher.addURI(authority,"tracks",TRACKS);
  matcher.addURI(authority,"tracks/*",TRACKS_ID);
  matcher.addURI(authority,"tracks/*/sessions",TRACKS_ID_SESSIONS);
  matcher.addURI(authority,"tracks/*/vendors",TRACKS_ID_VENDORS);
  matcher.addURI(authority,"rooms",ROOMS);
  matcher.addURI(authority,"rooms/*",ROOMS_ID);
  matcher.addURI(authority,"rooms/*/sessions",ROOMS_ID_SESSIONS);
  matcher.addURI(authority,"sessions",SESSIONS);
  matcher.addURI(authority,"sessions/starred",SESSIONS_STARRED);
  matcher.addURI(authority,"sessions/search/*",SESSIONS_SEARCH);
  matcher.addURI(authority,"sessions/at/*",SESSIONS_AT);
  matcher.addURI(authority,"sessions/*",SESSIONS_ID);
  matcher.addURI(authority,"sessions/*/speakers",SESSIONS_ID_SPEAKERS);
  matcher.addURI(authority,"sessions/*/tracks",SESSIONS_ID_TRACKS);
  matcher.addURI(authority,"speakers",SPEAKERS);
  matcher.addURI(authority,"speakers/*",SPEAKERS_ID);
  matcher.addURI(authority,"speakers/*/sessions",SPEAKERS_ID_SESSIONS);
  matcher.addURI(authority,"vendors",VENDORS);
  matcher.addURI(authority,"vendors/starred",VENDORS_STARRED);
  matcher.addURI(authority,"vendors/search/*",VENDORS_SEARCH);
  matcher.addURI(authority,"vendors/*",VENDORS_ID);
  matcher.addURI(authority,"search_suggest_query",SEARCH_SUGGEST);
  return matcher;
}
 

Example 27

From project iosched_3, under directory /android/src/com/google/android/apps/iosched/provider/.

Source file: ScheduleProvider.java

  17 
vote

/** 
 * Build and return a  {@link UriMatcher} that catches all {@link Uri}variations supported by this  {@link ContentProvider}.
 */
private static UriMatcher buildUriMatcher(){
  final UriMatcher matcher=new UriMatcher(UriMatcher.NO_MATCH);
  final String authority=ScheduleContract.CONTENT_AUTHORITY;
  matcher.addURI(authority,"blocks",BLOCKS);
  matcher.addURI(authority,"blocks/between/*/*",BLOCKS_BETWEEN);
  matcher.addURI(authority,"blocks/*",BLOCKS_ID);
  matcher.addURI(authority,"blocks/*/sessions",BLOCKS_ID_SESSIONS);
  matcher.addURI(authority,"blocks/*/sessions/starred",BLOCKS_ID_SESSIONS_STARRED);
  matcher.addURI(authority,"tracks",TRACKS);
  matcher.addURI(authority,"tracks/*",TRACKS_ID);
  matcher.addURI(authority,"tracks/*/sessions",TRACKS_ID_SESSIONS);
  matcher.addURI(authority,"tracks/*/vendors",TRACKS_ID_VENDORS);
  matcher.addURI(authority,"rooms",ROOMS);
  matcher.addURI(authority,"rooms/*",ROOMS_ID);
  matcher.addURI(authority,"rooms/*/sessions",ROOMS_ID_SESSIONS);
  matcher.addURI(authority,"sessions",SESSIONS);
  matcher.addURI(authority,"sessions/starred",SESSIONS_STARRED);
  matcher.addURI(authority,"sessions/with_track",SESSIONS_WITH_TRACK);
  matcher.addURI(authority,"sessions/search/*",SESSIONS_SEARCH);
  matcher.addURI(authority,"sessions/at/*",SESSIONS_AT);
  matcher.addURI(authority,"sessions/*",SESSIONS_ID);
  matcher.addURI(authority,"sessions/*/speakers",SESSIONS_ID_SPEAKERS);
  matcher.addURI(authority,"sessions/*/tracks",SESSIONS_ID_TRACKS);
  matcher.addURI(authority,"sessions/*/with_track",SESSIONS_ID_WITH_TRACK);
  matcher.addURI(authority,"speakers",SPEAKERS);
  matcher.addURI(authority,"speakers/*",SPEAKERS_ID);
  matcher.addURI(authority,"speakers/*/sessions",SPEAKERS_ID_SESSIONS);
  matcher.addURI(authority,"vendors",VENDORS);
  matcher.addURI(authority,"vendors/starred",VENDORS_STARRED);
  matcher.addURI(authority,"vendors/search/*",VENDORS_SEARCH);
  matcher.addURI(authority,"vendors/*",VENDORS_ID);
  matcher.addURI(authority,"announcements",ANNOUNCEMENTS);
  matcher.addURI(authority,"announcements/*",ANNOUNCEMENTS_ID);
  matcher.addURI(authority,"search_suggest_query",SEARCH_SUGGEST);
  return matcher;
}
 

Example 28

From project maven-android-plugin-samples, under directory /support4demos/src/com/example/android/supportv4/app/.

Source file: LoaderThrottleSupport.java

  17 
vote

/** 
 * Global provider initialization.
 */
public SimpleProvider(){
  mUriMatcher=new UriMatcher(UriMatcher.NO_MATCH);
  mUriMatcher.addURI(AUTHORITY,MainTable.TABLE_NAME,MAIN);
  mUriMatcher.addURI(AUTHORITY,MainTable.TABLE_NAME + "/#",MAIN_ID);
  mNotesProjectionMap=new HashMap<String,String>();
  mNotesProjectionMap.put(MainTable._ID,MainTable._ID);
  mNotesProjectionMap.put(MainTable.COLUMN_NAME_DATA,MainTable.COLUMN_NAME_DATA);
}
 

Example 29

From project ohmagePhone, under directory /src/org/ohmage/db/.

Source file: DbProvider.java

  17 
vote

private static UriMatcher buildUriMatcher(){
  final UriMatcher matcher=new UriMatcher(UriMatcher.NO_MATCH);
  matcher.addURI(DbContract.CONTENT_AUTHORITY,"campaigns",MatcherTypes.CAMPAIGNS);
  matcher.addURI(DbContract.CONTENT_AUTHORITY,"campaigns/*",MatcherTypes.CAMPAIGN_BY_URN);
  matcher.addURI(DbContract.CONTENT_AUTHORITY,"campaigns/*/responses",MatcherTypes.CAMPAIGN_RESPONSES);
  matcher.addURI(DbContract.CONTENT_AUTHORITY,"campaigns/*/surveys",MatcherTypes.CAMPAIGN_SURVEYS);
  matcher.addURI(DbContract.CONTENT_AUTHORITY,"campaigns/*/surveys/*",MatcherTypes.SURVEY_BY_ID);
  matcher.addURI(DbContract.CONTENT_AUTHORITY,"campaigns/*/surveys/*/prompts",MatcherTypes.SURVEY_SURVEYPROMPTS);
  matcher.addURI(DbContract.CONTENT_AUTHORITY,"campaigns/*/surveys/*/responses",MatcherTypes.CAMPAIGN_SURVEY_RESPONSES);
  matcher.addURI(DbContract.CONTENT_AUTHORITY,"campaigns/*/surveys/*/responses/prompts/*",MatcherTypes.CAMPAIGN_SURVEY_RESPONSES_PROMPTS_BY_ID);
  matcher.addURI(DbContract.CONTENT_AUTHORITY,"campaigns/*/responses/prompts/*",MatcherTypes.CAMPAIGN_RESPONSES_PROMPTS_BY_ID);
  matcher.addURI(DbContract.CONTENT_AUTHORITY,"surveys",MatcherTypes.SURVEYS);
  matcher.addURI(DbContract.CONTENT_AUTHORITY,"surveys/prompts",MatcherTypes.SURVEYPROMPTS);
  matcher.addURI(DbContract.CONTENT_AUTHORITY,"responses",MatcherTypes.RESPONSES);
  matcher.addURI(DbContract.CONTENT_AUTHORITY,"responses/#",MatcherTypes.RESPONSE_BY_PID);
  matcher.addURI(DbContract.CONTENT_AUTHORITY,"responses/#/prompts",MatcherTypes.RESPONSE_PROMPTS);
  matcher.addURI(DbContract.CONTENT_AUTHORITY,"prompts",MatcherTypes.PROMPTS);
  matcher.addURI(DbContract.CONTENT_AUTHORITY,"prompts/#",MatcherTypes.PROMPT_BY_PID);
  return matcher;
}
 

Example 30

From project Ohmage_Phone, under directory /src/org/ohmage/db/.

Source file: DbProvider.java

  17 
vote

private static UriMatcher buildUriMatcher(){
  final UriMatcher matcher=new UriMatcher(UriMatcher.NO_MATCH);
  matcher.addURI(DbContract.CONTENT_AUTHORITY,"campaigns",MatcherTypes.CAMPAIGNS);
  matcher.addURI(DbContract.CONTENT_AUTHORITY,"campaigns/*",MatcherTypes.CAMPAIGN_BY_URN);
  matcher.addURI(DbContract.CONTENT_AUTHORITY,"campaigns/*/responses",MatcherTypes.CAMPAIGN_RESPONSES);
  matcher.addURI(DbContract.CONTENT_AUTHORITY,"campaigns/*/surveys",MatcherTypes.CAMPAIGN_SURVEYS);
  matcher.addURI(DbContract.CONTENT_AUTHORITY,"campaigns/*/surveys/*",MatcherTypes.SURVEY_BY_ID);
  matcher.addURI(DbContract.CONTENT_AUTHORITY,"campaigns/*/surveys/*/prompts",MatcherTypes.SURVEY_SURVEYPROMPTS);
  matcher.addURI(DbContract.CONTENT_AUTHORITY,"campaigns/*/surveys/*/responses",MatcherTypes.CAMPAIGN_SURVEY_RESPONSES);
  matcher.addURI(DbContract.CONTENT_AUTHORITY,"campaigns/*/surveys/*/responses/prompts/*",MatcherTypes.CAMPAIGN_SURVEY_RESPONSES_PROMPTS_BY_ID);
  matcher.addURI(DbContract.CONTENT_AUTHORITY,"campaigns/*/surveys/*/responses/prompts/*/*",MatcherTypes.CAMPAIGN_SURVEY_RESPONSES_PROMPTS_BY_ID_AGGREGATE);
  matcher.addURI(DbContract.CONTENT_AUTHORITY,"surveys",MatcherTypes.SURVEYS);
  matcher.addURI(DbContract.CONTENT_AUTHORITY,"surveys/prompts",MatcherTypes.SURVEYPROMPTS);
  matcher.addURI(DbContract.CONTENT_AUTHORITY,"responses",MatcherTypes.RESPONSES);
  matcher.addURI(DbContract.CONTENT_AUTHORITY,"responses/#",MatcherTypes.RESPONSE_BY_PID);
  matcher.addURI(DbContract.CONTENT_AUTHORITY,"responses/#/prompts",MatcherTypes.RESPONSE_PROMPTS);
  matcher.addURI(DbContract.CONTENT_AUTHORITY,"prompts",MatcherTypes.PROMPTS);
  matcher.addURI(DbContract.CONTENT_AUTHORITY,"prompts/#",MatcherTypes.PROMPT_BY_PID);
  return matcher;
}
 

Example 31

From project PinDroid, under directory /src/com/pindroid/providers/.

Source file: BookmarkContentProvider.java

  17 
vote

private static UriMatcher buildUriMatcher(){
  UriMatcher matcher=new UriMatcher(UriMatcher.NO_MATCH);
  matcher.addURI(AUTHORITY,"bookmark",Bookmarks);
  matcher.addURI(AUTHORITY,"tag",Tags);
  matcher.addURI(AUTHORITY,"note",Notes);
  matcher.addURI(AUTHORITY,"main/" + SearchManager.SUGGEST_URI_PATH_QUERY,SearchSuggest);
  matcher.addURI(AUTHORITY,"main/" + SearchManager.SUGGEST_URI_PATH_QUERY + "/*",SearchSuggest);
  matcher.addURI(AUTHORITY,"tag/" + SearchManager.SUGGEST_URI_PATH_QUERY,TagSearchSuggest);
  matcher.addURI(AUTHORITY,"tag/" + SearchManager.SUGGEST_URI_PATH_QUERY + "/*",TagSearchSuggest);
  matcher.addURI(AUTHORITY,"bookmark/" + SearchManager.SUGGEST_URI_PATH_QUERY,BookmarkSearchSuggest);
  matcher.addURI(AUTHORITY,"bookmark/" + SearchManager.SUGGEST_URI_PATH_QUERY + "/*",BookmarkSearchSuggest);
  matcher.addURI(AUTHORITY,"note/" + SearchManager.SUGGEST_URI_PATH_QUERY,NoteSearchSuggest);
  matcher.addURI(AUTHORITY,"note/" + SearchManager.SUGGEST_URI_PATH_QUERY + "/*",NoteSearchSuggest);
  return matcher;
}
 

Example 32

From project SeriesGuide, under directory /SeriesGuide/src/com/battlelancer/seriesguide/provider/.

Source file: SeriesGuideProvider.java

  17 
vote

/** 
 * Build and return a  {@link UriMatcher} that catches all {@link Uri}variations supported by this  {@link ContentProvider}.
 */
private static UriMatcher buildUriMatcher(){
  final UriMatcher matcher=new UriMatcher(UriMatcher.NO_MATCH);
  final String authority=SeriesContract.CONTENT_AUTHORITY;
  matcher.addURI(authority,SeriesContract.PATH_SHOWS,SHOWS);
  matcher.addURI(authority,SeriesContract.PATH_SHOWS + "/" + SeriesContract.PATH_FILTER+ "/*",SHOWS_FILTERED);
  matcher.addURI(authority,SeriesContract.PATH_SHOWS + "/*",SHOWS_ID);
  matcher.addURI(authority,SeriesContract.PATH_EPISODES,EPISODES);
  matcher.addURI(authority,SeriesContract.PATH_EPISODES + "/" + SeriesContract.PATH_OFSEASON+ "/"+ SeriesContract.PATH_WITHSHOW+ "/*",EPISODES_OFSEASON_WITHSHOW);
  matcher.addURI(authority,SeriesContract.PATH_EPISODES + "/" + SeriesContract.PATH_OFSEASON+ "/*",EPISODES_OFSEASON);
  matcher.addURI(authority,SeriesContract.PATH_EPISODES + "/" + SeriesContract.PATH_OFSHOW+ "/*",EPISODES_OFSHOW);
  matcher.addURI(authority,SeriesContract.PATH_EPISODES + "/" + SeriesContract.PATH_WITHSHOW,EPISODES_WITHSHOW);
  matcher.addURI(authority,SeriesContract.PATH_EPISODES + "/" + SeriesContract.PATH_WITHSHOW+ "/*",EPISODES_ID_WITHSHOW);
  matcher.addURI(authority,SeriesContract.PATH_EPISODES + "/*",EPISODES_ID);
  matcher.addURI(authority,SeriesContract.PATH_SEASONS,SEASONS);
  matcher.addURI(authority,SeriesContract.PATH_SEASONS + "/" + SeriesContract.PATH_OFSHOW+ "/*",SEASONS_OFSHOW);
  matcher.addURI(authority,SeriesContract.PATH_SEASONS + "/*",SEASONS_ID);
  matcher.addURI(authority,SeriesContract.PATH_LISTS,LISTS);
  matcher.addURI(authority,SeriesContract.PATH_LISTS + "/" + SeriesContract.PATH_WITH_LIST_ITEM_ID+ "/*",LISTS_WITH_LIST_ITEM_ID);
  matcher.addURI(authority,SeriesContract.PATH_LISTS + "/*",LISTS_ID);
  matcher.addURI(authority,SeriesContract.PATH_LIST_ITEMS,LIST_ITEMS);
  matcher.addURI(authority,SeriesContract.PATH_LIST_ITEMS + "/" + SeriesContract.PATH_WITH_DETAILS,LIST_ITEMS_WITH_DETAILS);
  matcher.addURI(authority,SeriesContract.PATH_LIST_ITEMS + "/*",LIST_ITEMS_ID);
  matcher.addURI(authority,SeriesContract.PATH_EPISODESEARCH + "/" + SeriesContract.PATH_SEARCH,EPISODESEARCH);
  matcher.addURI(authority,SeriesContract.PATH_EPISODESEARCH + "/*",EPISODESEARCH_ID);
  matcher.addURI(authority,SearchManager.SUGGEST_URI_PATH_QUERY,SEARCH_SUGGEST);
  matcher.addURI(authority,SearchManager.SUGGEST_URI_PATH_QUERY + "/*",SEARCH_SUGGEST);
  matcher.addURI(authority,SeriesContract.PATH_RENEWFTSTABLE,RENEW_FTSTABLE);
  return matcher;
}
 

Example 33

From project SouthamptonUniversityMap, under directory /src/net/cbaines/suma/.

Source file: MapContentProvider.java

  17 
vote

/** 
 * Builds up a UriMatcher for search suggestion and shortcut refresh queries.
 */
private static UriMatcher buildUriMatcher(){
  UriMatcher matcher=new UriMatcher(UriMatcher.NO_MATCH);
  matcher.addURI(AUTHORITY,"all",SEARCH_BUILDINGS);
  matcher.addURI(AUTHORITY,"all/*",GET_BUILDING);
  matcher.addURI(AUTHORITY,"building",SEARCH_BUILDINGS);
  matcher.addURI(AUTHORITY,"building/*",GET_BUILDING);
  matcher.addURI(AUTHORITY,"bus-stop",SEARCH_BUS_STOPS);
  matcher.addURI(AUTHORITY,"bus-stop/*",GET_BUS_STOP);
  matcher.addURI(AUTHORITY,"site",SEARCH_SITES);
  matcher.addURI(AUTHORITY,"site/*",GET_SITE);
  matcher.addURI(AUTHORITY,"bus",SEARCH_BUSES);
  matcher.addURI(AUTHORITY,"bus/*",GET_BUS);
  matcher.addURI(AUTHORITY,SearchManager.SUGGEST_URI_PATH_QUERY,SEARCH_SUGGEST);
  matcher.addURI(AUTHORITY,SearchManager.SUGGEST_URI_PATH_QUERY + "/*",SEARCH_SUGGEST);
  matcher.addURI(AUTHORITY,SearchManager.SUGGEST_URI_PATH_SHORTCUT,REFRESH_SHORTCUT);
  matcher.addURI(AUTHORITY,SearchManager.SUGGEST_URI_PATH_SHORTCUT + "/*",REFRESH_SHORTCUT);
  return matcher;
}
 

Example 34

From project MIT-Mobile-for-Android, under directory /src/edu/mit/mitmobile2/.

Source file: MITSearchRecentsProvider.java

  16 
vote

/** 
 * code copied from superclass and amended to match our table columns
 */
@Override protected void setupSuggestions(String authority,int mode){
  if (TextUtils.isEmpty(authority) || ((mode & DATABASE_MODE_QUERIES) == 0)) {
    throw new IllegalArgumentException();
  }
  mTwoLineDisplay=(0 != (mode & DATABASE_MODE_2LINES));
  mAuthority=new String(authority);
  mMode=mode;
  mSuggestionsUri=Uri.parse("content://" + mAuthority + "/"+ TABLE_NAME);
  mUriMatcher=new UriMatcher(UriMatcher.NO_MATCH);
  mUriMatcher.addURI(mAuthority,SearchManager.SUGGEST_URI_PATH_QUERY,URI_MATCH_SUGGEST);
  if (mTwoLineDisplay) {
    mSuggestSuggestionClause="(" + SuggestionColumns.DISPLAY1 + " LIKE ? OR "+ SuggestionColumns.DISPLAY2+ " LIKE ?) AND "+ SuggestionColumns.AUTHORITY+ " LIKE ?";
    mSuggestionProjection=new String[]{"0 AS " + SearchManager.SUGGEST_COLUMN_FORMAT,SuggestionColumns.DISPLAY1 + " AS " + SearchManager.SUGGEST_COLUMN_TEXT_1,SuggestionColumns.DISPLAY2 + " AS " + SearchManager.SUGGEST_COLUMN_TEXT_2,SuggestionColumns.QUERY + " AS " + SearchManager.SUGGEST_COLUMN_QUERY,SuggestionColumns._ID};
  }
 else {
    mSuggestSuggestionClause=SuggestionColumns.DISPLAY1 + " LIKE ? AND " + SuggestionColumns.AUTHORITY+ " LIKE ?";
    mSuggestionProjection=new String[]{"0 AS " + SearchManager.SUGGEST_COLUMN_FORMAT,SuggestionColumns.DISPLAY1 + " AS " + SearchManager.SUGGEST_COLUMN_TEXT_1,SuggestionColumns.QUERY + " AS " + SearchManager.SUGGEST_COLUMN_QUERY,SuggestionColumns._ID};
  }
}
 

Example 35

From project nuxeo-android, under directory /nuxeo-android-connector/src/main/java/org/nuxeo/android/contentprovider/.

Source file: AbstractNuxeoReadOnlyContentProvider.java

  16 
vote

protected void initMapper(){
  String authority=NuxeoContentProviderConfig.getAuthority();
  uriMatcher=new UriMatcher(UriMatcher.NO_MATCH);
  uriMatcher.addURI(authority,ALL_DOCUMENTS,ALL_DOCUMENTS_PROVIDER);
  uriMatcher.addURI(authority,ALL_DOCUMENTS + "/*",ANY_DOCUMENT_PROVIDER);
  uriMatcher.addURI(authority,ICONS + "/*",ICONS_PROVIDER);
  uriMatcher.addURI(authority,ICONS + "/*/*",ICONS_PROVIDER);
  uriMatcher.addURI(authority,ICONS + "/*/*/*",ICONS_PROVIDER);
  uriMatcher.addURI(authority,ICONS + "/*/*/*/*",ICONS_PROVIDER);
  uriMatcher.addURI(authority,BLOBS + "/*",BLOBS_PROVIDER);
  uriMatcher.addURI(authority,BLOBS + "/*/#",BLOBS_PROVIDER);
  uriMatcher.addURI(authority,BLOBS + "/*/*",BLOBS_PROVIDER);
  uriMatcher.addURI(authority,BLOBS + "/*/*/*",BLOBS_PROVIDER);
  uriMatcher.addURI(authority,BLOBS + "/*/*/*/*",BLOBS_PROVIDER);
  uriMatcher.addURI(authority,PICTURES + "/*/*",PICTURES_PROVIDER);
  uriMatcher.addURI(authority,PICTURES + "/*",PICTURES_PROVIDER);
  uriMatcher.addURI(authority,"*",DOCUMENTS_PROVIDER);
  uriMatcher.addURI(authority,"*/*",DOCUMENT_PROVIDER);
  uriMatcher.addURI(authority,UPLOAD + "/*",UPLOAD_PROVIDER);
}
 

Example 36

From project platform_packages_providers_contactsprovider, under directory /src/com/android/providers/contacts/util/.

Source file: TypedUriMatcherImpl.java

  16 
vote

public TypedUriMatcherImpl(String authority,T[] values){
  mAuthority=authority;
  mValues=values;
  mUriMatcher=new UriMatcher(UriMatcher.NO_MATCH);
  T candidateNoMatchUriType=null;
  for (  T value : values) {
    String path=value.path();
    if (path != null) {
      addUriType(path,value);
    }
 else {
      candidateNoMatchUriType=value;
    }
  }
  this.mNoMatchUriType=candidateNoMatchUriType;
}
 

Example 37

From project android_packages_apps_Exchange, under directory /tests/src/com/android/exchange/provider/.

Source file: MockProvider.java

  15 
vote

@Override public Uri insert(Uri uri,ContentValues values){
  String table=uri.getPath().substring(1);
  long id=mMockId++;
  Uri newUri=new Uri.Builder().scheme("content").authority(AUTHORITY).path(table).appendPath(Long.toString(id)).build();
  values.put(ID_COLUMN,id);
  mMockStore.put(newUri.getPath(),values);
  int match=sURIMatcher.match(uri);
  if (match == UriMatcher.NO_MATCH) {
    sURIMatcher.addURI(AUTHORITY,table,TABLE);
    sURIMatcher.addURI(AUTHORITY,table + "/#",RECORD);
  }
  return newUri;
}
 

Example 38

From project dungbeetle, under directory /src/edu/stanford/mobisocial/dungbeetle/.

Source file: DungBeetleContentProvider.java

  15 
vote

@Override public String getType(Uri uri){
  int match=sUriMatcher.match(uri);
  if (match == UriMatcher.NO_MATCH) {
    return null;
  }
switch (match) {
case OBJS:
    return "vnd.android.cursor.dir/vnd.mobisocial.obj";
case OBJS_ID:
  return "vnd.android.cursor.item/vnd.mobisocial.obj";
case FEEDS:
return "vnd.android.cursor.dir/vnd.mobisocial.feed";
case FEEDS_ID:
return "vnd.android.cursor.item/vnd.mobisocial.feed";
}
throw new IllegalStateException("Unmatched-but-known content type");
}