UriMatcher addURI - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for UriMatcher addURI method.

This code example shows how to use the following methods:addURI
    public static final String TITLE="title";
    public static final String VALUE="value";
  } 
 
  static { 
    MATCHER=new UriMatcher(UriMatcher.NO_MATCH);
    MATCHER.addURI("com.commonsware.android.constants.Provider",
                   "constants", CONSTANTS);
    MATCHER.addURI("com.commonsware.android.constants.Provider",
                   "constants/#", CONSTANT_ID);
  } 
 
  private DatabaseHelper db=null;
 
  @Override 
  public boolean onCreate() { 
    db=new DatabaseHelper(getContext());
 
    return((db == null) ? false : true);
  } 
8
CodeRank
This code example shows how to use the following methods:addURI
This code example shows how to use the following methods:addURI
    private static final int SEARCH_SUGGEST = 2;
     
    private static final UriMatcher matcher = buildUriMatcher();
     
    private static UriMatcher buildUriMatcher() {
        UriMatcher umatcher = new UriMatcher(UriMatcher.NO_MATCH);
 
        umatcher.addURI(AUTHORITY, "sonnets", SEARCH);
        umatcher.addURI(AUTHORITY, "sonnets/#", GET_SONNET);
         
        umatcher.addURI(AUTHORITY, 
        				SearchManager.SUGGEST_URI_PATH_QUERY, 
        				SEARCH_SUGGEST);
        umatcher.addURI(AUTHORITY, 
        				SearchManager.SUGGEST_URI_PATH_QUERY + "/*", 
        				SEARCH_SUGGEST);
         
        return umatcher;
    } 
	 
8
CodeRank
This code example shows how to use the following methods:addURI
    public static final String TITLE="title";
    public static final String VALUE="value";
  } 
 
  static { 
    MATCHER=new UriMatcher(UriMatcher.NO_MATCH);
    MATCHER.addURI("com.commonsware.android.constants.Provider",
                   "constants", CONSTANTS);
    MATCHER.addURI("com.commonsware.android.constants.Provider",
                   "constants/#", CONSTANT_ID);
  } 
 
  private DatabaseHelper db=null;
 
  @Override 
  public boolean onCreate() { 
    db=new DatabaseHelper(getContext());
 
    return((db == null) ? false : true);
  } 
8
CodeRank
This code example shows how to use the following methods:addURI
			+ "/" + TABLE_ROSTER);
	public static final Uri GROUPS_URI = Uri.parse("content://" + AUTHORITY
			+ "/" + TABLE_GROUPS);
	public static final String QUERY_ALIAS = "main_result";
 
	private static final UriMatcher URI_MATCHER = new UriMatcher(
			UriMatcher.NO_MATCH);
	private static final int CONTACTS = 1;
	private static final int CONTACT_ID = 2;
	private static final int GROUPS = 3;
	private static final int GROUP_MEMBERS = 4;
 
	static { 
		URI_MATCHER.addURI(AUTHORITY, "roster", CONTACTS);
		URI_MATCHER.addURI(AUTHORITY, "roster/#", CONTACT_ID);
		URI_MATCHER.addURI(AUTHORITY, "groups", GROUPS);
		URI_MATCHER.addURI(AUTHORITY, "groups/*", GROUP_MEMBERS);
	} 
 
	private static final String TAG = "yaxim.RosterProvider";

8
CodeRank
This code example shows how to use the following methods:addURI
    public static final String TITLE="title";
    public static final String VALUE="value";
  } 
 
  static { 
    MATCHER=new UriMatcher(UriMatcher.NO_MATCH);
    MATCHER.addURI("com.commonsware.android.constants.Provider",
                   "constants", CONSTANTS);
    MATCHER.addURI("com.commonsware.android.constants.Provider",
                   "constants/#", CONSTANT_ID);
  } 
 
  private DatabaseHelper db=null;
  private String key=null;
 
  @Override 
  public boolean onCreate() { 
    SQLiteDatabase.loadLibs(getContext());
    db=(new DatabaseHelper(getContext()));
 
8
CodeRank
This code example shows how to use the following methods:addURI
    private static final int DIR = 1;
    private static final int FILE_NAME = 2;
 
    private static final UriMatcher uriMatcher;
    static { 
        uriMatcher = new UriMatcher(UriMatcher.NO_MATCH);
           uriMatcher.addURI(PROVIDER_NAME, "dir", DIR);
           uriMatcher.addURI(PROVIDER_NAME, "file", FILE_NAME);
        } 
 
    public int PruneDir(String sTmpDir) {
        int    nRet = 0;
        int nFiles = 0;
        String sSubDir = null;
 
        File dir = new File(sTmpDir);
 
        if (dir.isDirectory()) {
            File [] files = dir.listFiles();
            if (files != null) {
7
CodeRank
This code example shows how to use the following methods:addURI
    public static final String TITLE="title";
    public static final String VALUE="value";
  } 
 
  static { 
    MATCHER=new UriMatcher(UriMatcher.NO_MATCH);
    MATCHER.addURI("com.commonsware.android.constants.Provider",
                   "constants", CONSTANTS);
    MATCHER.addURI("com.commonsware.android.constants.Provider",
                   "constants/#", CONSTANT_ID);
  } 
 
  private DatabaseHelper db=null;
 
  @Override 
  public boolean onCreate() { 
    db=new DatabaseHelper(getContext());
 
    return((db == null) ? false : true);
  } 
8
CodeRank
This code example shows how to use the following methods:addURI
This code example shows how to use the following methods:addURI
    private static final int DIR = 1;
    private static final int FILE_NAME = 2;
 
    private static final UriMatcher uriMatcher;
    static { 
        uriMatcher = new UriMatcher(UriMatcher.NO_MATCH);
           uriMatcher.addURI(PROVIDER_NAME, "dir", DIR);
           uriMatcher.addURI(PROVIDER_NAME, "file", FILE_NAME);
        } 
 
    public int PruneDir(String sTmpDir) {
        int    nRet = 0;
        int nFiles = 0;
        String sSubDir = null;
 
        File dir = new File(sTmpDir);
 
        if (dir.isDirectory()) {
            File [] files = dir.listFiles();
            if (files != null) {
7
CodeRank

Related UriMatcher addURI Questions & Answers:

addURI Method Overview
Add a URI to match, and the code to return when this URI is matched.
See Code Examples for other Android UriMatcher Methods: