Search in sources :

Example 26 with UriMatcher

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

the class Traffic_Provider method onCreate.

@Override
public boolean onCreate() {
    AUTHORITY = getContext().getPackageName() + ".provider.traffic";
    sUriMatcher = new UriMatcher(UriMatcher.NO_MATCH);
    sUriMatcher.addURI(Traffic_Provider.AUTHORITY, DATABASE_TABLES[0], TRAFFIC);
    sUriMatcher.addURI(Traffic_Provider.AUTHORITY, DATABASE_TABLES[0] + "/#", TRAFFIC_ID);
    trafficProjectionMap = new HashMap<String, String>();
    trafficProjectionMap.put(Traffic_Data._ID, Traffic_Data._ID);
    trafficProjectionMap.put(Traffic_Data.TIMESTAMP, Traffic_Data.TIMESTAMP);
    trafficProjectionMap.put(Traffic_Data.DEVICE_ID, Traffic_Data.DEVICE_ID);
    trafficProjectionMap.put(Traffic_Data.NETWORK_TYPE, Traffic_Data.NETWORK_TYPE);
    trafficProjectionMap.put(Traffic_Data.RECEIVED_BYTES, Traffic_Data.RECEIVED_BYTES);
    trafficProjectionMap.put(Traffic_Data.SENT_BYTES, Traffic_Data.SENT_BYTES);
    trafficProjectionMap.put(Traffic_Data.RECEIVED_PACKETS, Traffic_Data.RECEIVED_PACKETS);
    trafficProjectionMap.put(Traffic_Data.SENT_PACKETS, Traffic_Data.SENT_PACKETS);
    return true;
}
Also used : UriMatcher(android.content.UriMatcher)

Example 27 with UriMatcher

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

the class WiFi_Provider method onCreate.

@Override
public boolean onCreate() {
    AUTHORITY = getContext().getPackageName() + ".provider.wifi";
    sUriMatcher = new UriMatcher(UriMatcher.NO_MATCH);
    sUriMatcher.addURI(WiFi_Provider.AUTHORITY, DATABASE_TABLES[0], WIFI_DATA);
    sUriMatcher.addURI(WiFi_Provider.AUTHORITY, DATABASE_TABLES[0] + "/#", WIFI_DATA_ID);
    sUriMatcher.addURI(WiFi_Provider.AUTHORITY, DATABASE_TABLES[1], WIFI_DEV);
    sUriMatcher.addURI(WiFi_Provider.AUTHORITY, DATABASE_TABLES[1] + "/#", WIFI_DEV_ID);
    wifiDataMap = new HashMap<String, String>();
    wifiDataMap.put(WiFi_Data._ID, WiFi_Data._ID);
    wifiDataMap.put(WiFi_Data.TIMESTAMP, WiFi_Data.TIMESTAMP);
    wifiDataMap.put(WiFi_Data.DEVICE_ID, WiFi_Data.DEVICE_ID);
    wifiDataMap.put(WiFi_Data.BSSID, WiFi_Data.BSSID);
    wifiDataMap.put(WiFi_Data.SSID, WiFi_Data.SSID);
    wifiDataMap.put(WiFi_Data.SECURITY, WiFi_Data.SECURITY);
    wifiDataMap.put(WiFi_Data.FREQUENCY, WiFi_Data.FREQUENCY);
    wifiDataMap.put(WiFi_Data.RSSI, WiFi_Data.RSSI);
    wifiDataMap.put(WiFi_Data.LABEL, WiFi_Data.LABEL);
    wifiDeviceMap = new HashMap<String, String>();
    wifiDeviceMap.put(WiFi_Sensor._ID, WiFi_Sensor._ID);
    wifiDeviceMap.put(WiFi_Sensor.DEVICE_ID, WiFi_Sensor.DEVICE_ID);
    wifiDeviceMap.put(WiFi_Sensor.TIMESTAMP, WiFi_Sensor.TIMESTAMP);
    wifiDeviceMap.put(WiFi_Sensor.MAC_ADDRESS, WiFi_Sensor.MAC_ADDRESS);
    wifiDeviceMap.put(WiFi_Sensor.BSSID, WiFi_Sensor.BSSID);
    wifiDeviceMap.put(WiFi_Sensor.SSID, WiFi_Sensor.SSID);
    return true;
}
Also used : UriMatcher(android.content.UriMatcher)

Example 28 with UriMatcher

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

the class Applications_Provider method onCreate.

@Override
public boolean onCreate() {
    AUTHORITY = getContext().getPackageName() + ".provider.applications";
    sUriMatcher = new UriMatcher(UriMatcher.NO_MATCH);
    sUriMatcher.addURI(Applications_Provider.AUTHORITY, DATABASE_TABLES[0], FOREGROUND);
    sUriMatcher.addURI(Applications_Provider.AUTHORITY, DATABASE_TABLES[0] + "/#", FOREGROUND_ID);
    sUriMatcher.addURI(Applications_Provider.AUTHORITY, DATABASE_TABLES[1], APPLICATIONS);
    sUriMatcher.addURI(Applications_Provider.AUTHORITY, DATABASE_TABLES[1] + "/#", APPLICATIONS_ID);
    sUriMatcher.addURI(Applications_Provider.AUTHORITY, DATABASE_TABLES[2], NOTIFICATIONS);
    sUriMatcher.addURI(Applications_Provider.AUTHORITY, DATABASE_TABLES[2] + "/#", NOTIFICATIONS_ID);
    sUriMatcher.addURI(Applications_Provider.AUTHORITY, DATABASE_TABLES[3], ERROR);
    sUriMatcher.addURI(Applications_Provider.AUTHORITY, DATABASE_TABLES[3] + "/#", ERROR_ID);
    foregroundMap = new HashMap<String, String>();
    foregroundMap.put(Applications_Foreground._ID, Applications_Foreground._ID);
    foregroundMap.put(Applications_Foreground.TIMESTAMP, Applications_Foreground.TIMESTAMP);
    foregroundMap.put(Applications_Foreground.DEVICE_ID, Applications_Foreground.DEVICE_ID);
    foregroundMap.put(Applications_Foreground.PACKAGE_NAME, Applications_Foreground.PACKAGE_NAME);
    foregroundMap.put(Applications_Foreground.APPLICATION_NAME, Applications_Foreground.APPLICATION_NAME);
    foregroundMap.put(Applications_Foreground.IS_SYSTEM_APP, Applications_Foreground.IS_SYSTEM_APP);
    applicationsMap = new HashMap<String, String>();
    applicationsMap.put(Applications_History._ID, Applications_History._ID);
    applicationsMap.put(Applications_History.TIMESTAMP, Applications_History.TIMESTAMP);
    applicationsMap.put(Applications_History.DEVICE_ID, Applications_History.DEVICE_ID);
    applicationsMap.put(Applications_History.PACKAGE_NAME, Applications_History.PACKAGE_NAME);
    applicationsMap.put(Applications_History.APPLICATION_NAME, Applications_History.APPLICATION_NAME);
    applicationsMap.put(Applications_History.PROCESS_IMPORTANCE, Applications_History.PROCESS_IMPORTANCE);
    applicationsMap.put(Applications_History.PROCESS_ID, Applications_History.PROCESS_ID);
    applicationsMap.put(Applications_History.END_TIMESTAMP, Applications_History.END_TIMESTAMP);
    applicationsMap.put(Applications_History.IS_SYSTEM_APP, Applications_History.IS_SYSTEM_APP);
    notificationMap = new HashMap<String, String>();
    notificationMap.put(Applications_Notifications._ID, Applications_Notifications._ID);
    notificationMap.put(Applications_Notifications.TIMESTAMP, Applications_Notifications.TIMESTAMP);
    notificationMap.put(Applications_Notifications.DEVICE_ID, Applications_Notifications.DEVICE_ID);
    notificationMap.put(Applications_Notifications.PACKAGE_NAME, Applications_Notifications.PACKAGE_NAME);
    notificationMap.put(Applications_Notifications.APPLICATION_NAME, Applications_Notifications.APPLICATION_NAME);
    notificationMap.put(Applications_Notifications.TEXT, Applications_Notifications.TEXT);
    notificationMap.put(Applications_Notifications.SOUND, Applications_Notifications.SOUND);
    notificationMap.put(Applications_Notifications.VIBRATE, Applications_Notifications.VIBRATE);
    notificationMap.put(Applications_Notifications.FLAGS, Applications_Notifications.FLAGS);
    notificationMap.put(Applications_Notifications.DEFAULTS, Applications_Notifications.DEFAULTS);
    crashesMap = new HashMap<String, String>();
    crashesMap.put(Applications_Crashes._ID, Applications_Crashes._ID);
    crashesMap.put(Applications_Crashes.TIMESTAMP, Applications_Crashes.TIMESTAMP);
    crashesMap.put(Applications_Crashes.DEVICE_ID, Applications_Crashes.DEVICE_ID);
    crashesMap.put(Applications_Crashes.PACKAGE_NAME, Applications_Crashes.PACKAGE_NAME);
    crashesMap.put(Applications_Crashes.APPLICATION_NAME, Applications_Crashes.APPLICATION_NAME);
    crashesMap.put(Applications_Crashes.APPLICATION_VERSION, Applications_Crashes.APPLICATION_VERSION);
    crashesMap.put(Applications_Crashes.ERROR_SHORT, Applications_Crashes.ERROR_SHORT);
    crashesMap.put(Applications_Crashes.ERROR_LONG, Applications_Crashes.ERROR_LONG);
    crashesMap.put(Applications_Crashes.ERROR_CONDITION, Applications_Crashes.ERROR_CONDITION);
    crashesMap.put(Applications_Crashes.IS_SYSTEM_APP, Applications_Crashes.IS_SYSTEM_APP);
    return true;
}
Also used : UriMatcher(android.content.UriMatcher)

Example 29 with UriMatcher

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

the class Aware_Provider method onCreate.

@Override
public boolean onCreate() {
    AUTHORITY = getContext().getPackageName() + ".provider.aware";
    sUriMatcher = new UriMatcher(UriMatcher.NO_MATCH);
    sUriMatcher.addURI(Aware_Provider.AUTHORITY, DATABASE_TABLES[0], DEVICE_INFO);
    sUriMatcher.addURI(Aware_Provider.AUTHORITY, DATABASE_TABLES[0] + "/#", DEVICE_INFO_ID);
    sUriMatcher.addURI(Aware_Provider.AUTHORITY, DATABASE_TABLES[1], SETTING);
    sUriMatcher.addURI(Aware_Provider.AUTHORITY, DATABASE_TABLES[1] + "/#", SETTING_ID);
    sUriMatcher.addURI(Aware_Provider.AUTHORITY, DATABASE_TABLES[2], PLUGIN);
    sUriMatcher.addURI(Aware_Provider.AUTHORITY, DATABASE_TABLES[2] + "/#", PLUGIN_ID);
    sUriMatcher.addURI(Aware_Provider.AUTHORITY, DATABASE_TABLES[3], STUDY);
    sUriMatcher.addURI(Aware_Provider.AUTHORITY, DATABASE_TABLES[3] + "/#", STUDY_ID);
    sUriMatcher.addURI(Aware_Provider.AUTHORITY, DATABASE_TABLES[4], LOG);
    sUriMatcher.addURI(Aware_Provider.AUTHORITY, DATABASE_TABLES[4] + "/#", LOG_ID);
    deviceMap = new HashMap<>();
    deviceMap.put(Aware_Device._ID, Aware_Device._ID);
    deviceMap.put(Aware_Device.TIMESTAMP, Aware_Device.TIMESTAMP);
    deviceMap.put(Aware_Device.DEVICE_ID, Aware_Device.DEVICE_ID);
    deviceMap.put(Aware_Device.BOARD, Aware_Device.BOARD);
    deviceMap.put(Aware_Device.BRAND, Aware_Device.BRAND);
    deviceMap.put(Aware_Device.DEVICE, Aware_Device.DEVICE);
    deviceMap.put(Aware_Device.BUILD_ID, Aware_Device.BUILD_ID);
    deviceMap.put(Aware_Device.HARDWARE, Aware_Device.HARDWARE);
    deviceMap.put(Aware_Device.MANUFACTURER, Aware_Device.MANUFACTURER);
    deviceMap.put(Aware_Device.MODEL, Aware_Device.MODEL);
    deviceMap.put(Aware_Device.PRODUCT, Aware_Device.PRODUCT);
    deviceMap.put(Aware_Device.SERIAL, Aware_Device.SERIAL);
    deviceMap.put(Aware_Device.RELEASE, Aware_Device.RELEASE);
    deviceMap.put(Aware_Device.RELEASE_TYPE, Aware_Device.RELEASE_TYPE);
    deviceMap.put(Aware_Device.SDK, Aware_Device.SDK);
    deviceMap.put(Aware_Device.LABEL, Aware_Device.LABEL);
    settingsMap = new HashMap<>();
    settingsMap.put(Aware_Settings.SETTING_ID, Aware_Settings.SETTING_ID);
    settingsMap.put(Aware_Settings.SETTING_KEY, Aware_Settings.SETTING_KEY);
    settingsMap.put(Aware_Settings.SETTING_VALUE, Aware_Settings.SETTING_VALUE);
    settingsMap.put(Aware_Settings.SETTING_PACKAGE_NAME, Aware_Settings.SETTING_PACKAGE_NAME);
    pluginsMap = new HashMap<>();
    pluginsMap.put(Aware_Plugins.PLUGIN_ID, Aware_Plugins.PLUGIN_ID);
    pluginsMap.put(Aware_Plugins.PLUGIN_PACKAGE_NAME, Aware_Plugins.PLUGIN_PACKAGE_NAME);
    pluginsMap.put(Aware_Plugins.PLUGIN_NAME, Aware_Plugins.PLUGIN_NAME);
    pluginsMap.put(Aware_Plugins.PLUGIN_VERSION, Aware_Plugins.PLUGIN_VERSION);
    pluginsMap.put(Aware_Plugins.PLUGIN_STATUS, Aware_Plugins.PLUGIN_STATUS);
    pluginsMap.put(Aware_Plugins.PLUGIN_AUTHOR, Aware_Plugins.PLUGIN_AUTHOR);
    pluginsMap.put(Aware_Plugins.PLUGIN_ICON, Aware_Plugins.PLUGIN_ICON);
    pluginsMap.put(Aware_Plugins.PLUGIN_DESCRIPTION, Aware_Plugins.PLUGIN_DESCRIPTION);
    studiesMap = new HashMap<>();
    studiesMap.put(Aware_Studies.STUDY_ID, Aware_Studies.STUDY_ID);
    studiesMap.put(Aware_Studies.STUDY_TIMESTAMP, Aware_Studies.STUDY_TIMESTAMP);
    studiesMap.put(Aware_Studies.STUDY_DEVICE_ID, Aware_Studies.STUDY_DEVICE_ID);
    studiesMap.put(Aware_Studies.STUDY_URL, Aware_Studies.STUDY_URL);
    studiesMap.put(Aware_Studies.STUDY_KEY, Aware_Studies.STUDY_KEY);
    studiesMap.put(Aware_Studies.STUDY_API, Aware_Studies.STUDY_API);
    studiesMap.put(Aware_Studies.STUDY_PI, Aware_Studies.STUDY_PI);
    studiesMap.put(Aware_Studies.STUDY_CONFIG, Aware_Studies.STUDY_CONFIG);
    studiesMap.put(Aware_Studies.STUDY_TITLE, Aware_Studies.STUDY_TITLE);
    studiesMap.put(Aware_Studies.STUDY_DESCRIPTION, Aware_Studies.STUDY_DESCRIPTION);
    studiesMap.put(Aware_Studies.STUDY_JOINED, Aware_Studies.STUDY_JOINED);
    studiesMap.put(Aware_Studies.STUDY_EXIT, Aware_Studies.STUDY_EXIT);
    studiesMap.put(Aware_Studies.STUDY_COMPLIANCE, Aware_Studies.STUDY_COMPLIANCE);
    logMap = new HashMap<>();
    logMap.put(Aware_Log.LOG_ID, Aware_Log.LOG_ID);
    logMap.put(Aware_Log.LOG_TIMESTAMP, Aware_Log.LOG_TIMESTAMP);
    logMap.put(Aware_Log.LOG_DEVICE_ID, Aware_Log.LOG_DEVICE_ID);
    logMap.put(Aware_Log.LOG_MESSAGE, Aware_Log.LOG_MESSAGE);
    return true;
}
Also used : UriMatcher(android.content.UriMatcher)

Example 30 with UriMatcher

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

the class Battery_Provider method onCreate.

@Override
public boolean onCreate() {
    AUTHORITY = getContext().getPackageName() + ".provider.battery";
    sUriMatcher = new UriMatcher(UriMatcher.NO_MATCH);
    sUriMatcher.addURI(Battery_Provider.AUTHORITY, DATABASE_TABLES[0], BATTERY);
    sUriMatcher.addURI(Battery_Provider.AUTHORITY, DATABASE_TABLES[0] + "/#", BATTERY_ID);
    sUriMatcher.addURI(Battery_Provider.AUTHORITY, DATABASE_TABLES[1], BATTERY_DISCHARGE);
    sUriMatcher.addURI(Battery_Provider.AUTHORITY, DATABASE_TABLES[1] + "/#", BATTERY_DISCHARGE_ID);
    sUriMatcher.addURI(Battery_Provider.AUTHORITY, DATABASE_TABLES[2], BATTERY_CHARGE);
    sUriMatcher.addURI(Battery_Provider.AUTHORITY, DATABASE_TABLES[2] + "/#", BATTERY_CHARGE_ID);
    batteryProjectionMap = new HashMap<String, String>();
    batteryProjectionMap.put(Battery_Data._ID, Battery_Data._ID);
    batteryProjectionMap.put(Battery_Data.TIMESTAMP, Battery_Data.TIMESTAMP);
    batteryProjectionMap.put(Battery_Data.DEVICE_ID, Battery_Data.DEVICE_ID);
    batteryProjectionMap.put(Battery_Data.STATUS, Battery_Data.STATUS);
    batteryProjectionMap.put(Battery_Data.LEVEL, Battery_Data.LEVEL);
    batteryProjectionMap.put(Battery_Data.SCALE, Battery_Data.SCALE);
    batteryProjectionMap.put(Battery_Data.VOLTAGE, Battery_Data.VOLTAGE);
    batteryProjectionMap.put(Battery_Data.TEMPERATURE, Battery_Data.TEMPERATURE);
    batteryProjectionMap.put(Battery_Data.PLUG_ADAPTOR, Battery_Data.PLUG_ADAPTOR);
    batteryProjectionMap.put(Battery_Data.HEALTH, Battery_Data.HEALTH);
    batteryProjectionMap.put(Battery_Data.TECHNOLOGY, Battery_Data.TECHNOLOGY);
    batteryDischargesMap = new HashMap<String, String>();
    batteryDischargesMap.put(Battery_Discharges._ID, Battery_Discharges._ID);
    batteryDischargesMap.put(Battery_Discharges.TIMESTAMP, Battery_Discharges.TIMESTAMP);
    batteryDischargesMap.put(Battery_Discharges.DEVICE_ID, Battery_Discharges.DEVICE_ID);
    batteryDischargesMap.put(Battery_Discharges.BATTERY_START, Battery_Discharges.BATTERY_START);
    batteryDischargesMap.put(Battery_Discharges.BATTERY_END, Battery_Discharges.BATTERY_END);
    batteryDischargesMap.put(Battery_Discharges.END_TIMESTAMP, Battery_Discharges.END_TIMESTAMP);
    batteryChargesMap = new HashMap<String, String>();
    batteryChargesMap.put(Battery_Charges._ID, Battery_Charges._ID);
    batteryChargesMap.put(Battery_Charges.TIMESTAMP, Battery_Charges.TIMESTAMP);
    batteryChargesMap.put(Battery_Charges.DEVICE_ID, Battery_Charges.DEVICE_ID);
    batteryChargesMap.put(Battery_Charges.BATTERY_START, Battery_Charges.BATTERY_START);
    batteryChargesMap.put(Battery_Charges.BATTERY_END, Battery_Charges.BATTERY_END);
    batteryChargesMap.put(Battery_Charges.END_TIMESTAMP, Battery_Charges.END_TIMESTAMP);
    return true;
}
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