Search in sources :

Example 41 with UriMatcher

use of android.content.UriMatcher in project aware-client by denzilferreira.

the class Scheduler_Provider method onCreate.

@Override
public boolean onCreate() {
    AUTHORITY = getContext().getPackageName() + ".provider.scheduler";
    sUriMatcher = new UriMatcher(UriMatcher.NO_MATCH);
    sUriMatcher.addURI(Scheduler_Provider.AUTHORITY, DATABASE_TABLES[0], SCHEDULER);
    sUriMatcher.addURI(Scheduler_Provider.AUTHORITY, DATABASE_TABLES[0] + "/#", SCHEDULER_ID);
    dataMap = new HashMap<>();
    dataMap.put(Scheduler_Data._ID, Scheduler_Data._ID);
    dataMap.put(Scheduler_Data.TIMESTAMP, Scheduler_Data.TIMESTAMP);
    dataMap.put(Scheduler_Data.DEVICE_ID, Scheduler_Data.DEVICE_ID);
    dataMap.put(Scheduler_Data.SCHEDULE_ID, Scheduler_Data.SCHEDULE_ID);
    dataMap.put(Scheduler_Data.SCHEDULE, Scheduler_Data.SCHEDULE);
    dataMap.put(Scheduler_Data.LAST_TRIGGERED, Scheduler_Data.LAST_TRIGGERED);
    dataMap.put(Scheduler_Data.PACKAGE_NAME, Scheduler_Data.PACKAGE_NAME);
    return true;
}
Also used : UriMatcher(android.content.UriMatcher)

Example 42 with UriMatcher

use of android.content.UriMatcher in project aware-client by denzilferreira.

the class Screen_Provider method onCreate.

@Override
public boolean onCreate() {
    AUTHORITY = getContext().getPackageName() + ".provider.screen";
    sUriMatcher = new UriMatcher(UriMatcher.NO_MATCH);
    sUriMatcher.addURI(Screen_Provider.AUTHORITY, DATABASE_TABLES[0], SCREEN);
    sUriMatcher.addURI(Screen_Provider.AUTHORITY, DATABASE_TABLES[0] + "/#", SCREEN_ID);
    sUriMatcher.addURI(Screen_Provider.AUTHORITY, DATABASE_TABLES[1], TOUCH);
    sUriMatcher.addURI(Screen_Provider.AUTHORITY, DATABASE_TABLES[1] + "/#", TOUCH_ID);
    screenProjectionMap = new HashMap<>();
    screenProjectionMap.put(Screen_Data._ID, Screen_Data._ID);
    screenProjectionMap.put(Screen_Data.TIMESTAMP, Screen_Data.TIMESTAMP);
    screenProjectionMap.put(Screen_Data.DEVICE_ID, Screen_Data.DEVICE_ID);
    screenProjectionMap.put(Screen_Data.SCREEN_STATUS, Screen_Data.SCREEN_STATUS);
    touchProjectionMap = new HashMap<>();
    touchProjectionMap.put(Screen_Touch._ID, Screen_Touch._ID);
    touchProjectionMap.put(Screen_Touch.TIMESTAMP, Screen_Touch.TIMESTAMP);
    touchProjectionMap.put(Screen_Touch.DEVICE_ID, Screen_Touch.DEVICE_ID);
    touchProjectionMap.put(Screen_Touch.TOUCH_APP, Screen_Touch.TOUCH_APP);
    touchProjectionMap.put(Screen_Touch.TOUCH_ACTION, Screen_Touch.TOUCH_ACTION);
    touchProjectionMap.put(Screen_Touch.TOUCH_ACTION_TEXT, Screen_Touch.TOUCH_ACTION_TEXT);
    touchProjectionMap.put(Screen_Touch.TOUCH_INDEX_ITEMS, Screen_Touch.TOUCH_INDEX_ITEMS);
    touchProjectionMap.put(Screen_Touch.TOUCH_FROM_INDEX, Screen_Touch.TOUCH_FROM_INDEX);
    touchProjectionMap.put(Screen_Touch.TOUCH_TO_INDEX, Screen_Touch.TOUCH_TO_INDEX);
    return true;
}
Also used : UriMatcher(android.content.UriMatcher)

Example 43 with UriMatcher

use of android.content.UriMatcher in project tray by grandcentrix.

the class TrayContentProvider method setAuthority.

/**
     * @see TrayContract#setAuthority(String)
     */
static void setAuthority(final String authority) {
    sURIMatcher = new UriMatcher(UriMatcher.NO_MATCH);
    sURIMatcher.addURI(authority, TrayContract.Preferences.BASE_PATH, ALL_PREFERENCE);
    // BASE/module
    sURIMatcher.addURI(authority, TrayContract.Preferences.BASE_PATH + "/*", MODULE_PREFERENCE);
    // BASE/module/key
    sURIMatcher.addURI(authority, TrayContract.Preferences.BASE_PATH + "/*/*", SINGLE_PREFERENCE);
    sURIMatcher.addURI(authority, TrayContract.InternalPreferences.BASE_PATH, INTERNAL_ALL_PREFERENCE);
    // INTERNAL_BASE/module
    sURIMatcher.addURI(authority, TrayContract.InternalPreferences.BASE_PATH + "/*", INTERNAL_MODULE_PREFERENCE);
    // INTERNAL_BASE/module/key
    sURIMatcher.addURI(authority, TrayContract.InternalPreferences.BASE_PATH + "/*/*", INTERNAL_SINGLE_PREFERENCE);
}
Also used : UriMatcher(android.content.UriMatcher)

Example 44 with UriMatcher

use of android.content.UriMatcher in project restful-android by jeremyhaberman.

the class ProfileProvider method onCreate.

@Override
public boolean onCreate() {
    uriMatcher = new UriMatcher(UriMatcher.NO_MATCH);
    uriMatcher.addURI(AUTHORITY, "profiles", PROFILES);
    uriMatcher.addURI(AUTHORITY, "profiles/#", PROFILE_ID);
    profiles = new ProfileData(getContext());
    return true;
}
Also used : UriMatcher(android.content.UriMatcher)

Example 45 with UriMatcher

use of android.content.UriMatcher in project muzei by romannurik.

the class MuzeiProvider method buildUriMatcher.

/**
     * Creates and initializes the URI matcher
     *
     * @return the URI Matcher
     */
private static UriMatcher buildUriMatcher() {
    final UriMatcher matcher = new UriMatcher(UriMatcher.NO_MATCH);
    matcher.addURI(MuzeiContract.AUTHORITY, MuzeiContract.Artwork.TABLE_NAME, MuzeiProvider.ARTWORK);
    matcher.addURI(MuzeiContract.AUTHORITY, MuzeiContract.Artwork.TABLE_NAME + "/#", MuzeiProvider.ARTWORK_ID);
    matcher.addURI(MuzeiContract.AUTHORITY, MuzeiContract.Sources.TABLE_NAME, MuzeiProvider.SOURCES);
    matcher.addURI(MuzeiContract.AUTHORITY, MuzeiContract.Sources.TABLE_NAME + "/#", MuzeiProvider.SOURCE_ID);
    return matcher;
}
Also used : UriMatcher(android.content.UriMatcher)

Aggregations

UriMatcher (android.content.UriMatcher)69 SmallTest (android.test.suitebuilder.annotation.SmallTest)13 TableDetails (me.himanshusoni.quantumflux.model.generate.TableDetails)1