Search in sources :

Example 61 with UriMatcher

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

the class Accelerometer_Provider method onCreate.

@Override
public boolean onCreate() {
    AUTHORITY = getContext().getPackageName() + ".provider.accelerometer";
    sUriMatcher = new UriMatcher(UriMatcher.NO_MATCH);
    sUriMatcher.addURI(Accelerometer_Provider.AUTHORITY, DATABASE_TABLES[0], ACCEL_DEV);
    sUriMatcher.addURI(Accelerometer_Provider.AUTHORITY, DATABASE_TABLES[0] + "/#", ACCEL_DEV_ID);
    sUriMatcher.addURI(Accelerometer_Provider.AUTHORITY, DATABASE_TABLES[1], ACCEL_DATA);
    sUriMatcher.addURI(Accelerometer_Provider.AUTHORITY, DATABASE_TABLES[1] + "/#", ACCEL_DATA_ID);
    accelDeviceMap = new HashMap<>();
    accelDeviceMap.put(Accelerometer_Sensor._ID, Accelerometer_Sensor._ID);
    accelDeviceMap.put(Accelerometer_Sensor.TIMESTAMP, Accelerometer_Sensor.TIMESTAMP);
    accelDeviceMap.put(Accelerometer_Sensor.DEVICE_ID, Accelerometer_Sensor.DEVICE_ID);
    accelDeviceMap.put(Accelerometer_Sensor.MAXIMUM_RANGE, Accelerometer_Sensor.MAXIMUM_RANGE);
    accelDeviceMap.put(Accelerometer_Sensor.MINIMUM_DELAY, Accelerometer_Sensor.MINIMUM_DELAY);
    accelDeviceMap.put(Accelerometer_Sensor.NAME, Accelerometer_Sensor.NAME);
    accelDeviceMap.put(Accelerometer_Sensor.POWER_MA, Accelerometer_Sensor.POWER_MA);
    accelDeviceMap.put(Accelerometer_Sensor.RESOLUTION, Accelerometer_Sensor.RESOLUTION);
    accelDeviceMap.put(Accelerometer_Sensor.TYPE, Accelerometer_Sensor.TYPE);
    accelDeviceMap.put(Accelerometer_Sensor.VENDOR, Accelerometer_Sensor.VENDOR);
    accelDeviceMap.put(Accelerometer_Sensor.VERSION, Accelerometer_Sensor.VERSION);
    accelDataMap = new HashMap<>();
    accelDataMap.put(Accelerometer_Data._ID, Accelerometer_Data._ID);
    accelDataMap.put(Accelerometer_Data.TIMESTAMP, Accelerometer_Data.TIMESTAMP);
    accelDataMap.put(Accelerometer_Data.DEVICE_ID, Accelerometer_Data.DEVICE_ID);
    accelDataMap.put(Accelerometer_Data.VALUES_0, Accelerometer_Data.VALUES_0);
    accelDataMap.put(Accelerometer_Data.VALUES_1, Accelerometer_Data.VALUES_1);
    accelDataMap.put(Accelerometer_Data.VALUES_2, Accelerometer_Data.VALUES_2);
    accelDataMap.put(Accelerometer_Data.ACCURACY, Accelerometer_Data.ACCURACY);
    accelDataMap.put(Accelerometer_Data.LABEL, Accelerometer_Data.LABEL);
    return true;
}
Also used : UriMatcher(android.content.UriMatcher)

Example 62 with UriMatcher

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

the class Barometer_Provider method onCreate.

@Override
public boolean onCreate() {
    AUTHORITY = getContext().getPackageName() + ".provider.barometer";
    sUriMatcher = new UriMatcher(UriMatcher.NO_MATCH);
    sUriMatcher.addURI(Barometer_Provider.AUTHORITY, DATABASE_TABLES[0], SENSOR_DEV);
    sUriMatcher.addURI(Barometer_Provider.AUTHORITY, DATABASE_TABLES[0] + "/#", SENSOR_DEV_ID);
    sUriMatcher.addURI(Barometer_Provider.AUTHORITY, DATABASE_TABLES[1], SENSOR_DATA);
    sUriMatcher.addURI(Barometer_Provider.AUTHORITY, DATABASE_TABLES[1] + "/#", SENSOR_DATA_ID);
    sensorMap = new HashMap<String, String>();
    sensorMap.put(Barometer_Sensor._ID, Barometer_Sensor._ID);
    sensorMap.put(Barometer_Sensor.TIMESTAMP, Barometer_Sensor.TIMESTAMP);
    sensorMap.put(Barometer_Sensor.DEVICE_ID, Barometer_Sensor.DEVICE_ID);
    sensorMap.put(Barometer_Sensor.MAXIMUM_RANGE, Barometer_Sensor.MAXIMUM_RANGE);
    sensorMap.put(Barometer_Sensor.MINIMUM_DELAY, Barometer_Sensor.MINIMUM_DELAY);
    sensorMap.put(Barometer_Sensor.NAME, Barometer_Sensor.NAME);
    sensorMap.put(Barometer_Sensor.POWER_MA, Barometer_Sensor.POWER_MA);
    sensorMap.put(Barometer_Sensor.RESOLUTION, Barometer_Sensor.RESOLUTION);
    sensorMap.put(Barometer_Sensor.TYPE, Barometer_Sensor.TYPE);
    sensorMap.put(Barometer_Sensor.VENDOR, Barometer_Sensor.VENDOR);
    sensorMap.put(Barometer_Sensor.VERSION, Barometer_Sensor.VERSION);
    sensorDataMap = new HashMap<String, String>();
    sensorDataMap.put(Barometer_Data._ID, Barometer_Data._ID);
    sensorDataMap.put(Barometer_Data.TIMESTAMP, Barometer_Data.TIMESTAMP);
    sensorDataMap.put(Barometer_Data.DEVICE_ID, Barometer_Data.DEVICE_ID);
    sensorDataMap.put(Barometer_Data.AMBIENT_PRESSURE, Barometer_Data.AMBIENT_PRESSURE);
    sensorDataMap.put(Barometer_Data.ACCURACY, Barometer_Data.ACCURACY);
    sensorDataMap.put(Barometer_Data.LABEL, Barometer_Data.LABEL);
    return true;
}
Also used : UriMatcher(android.content.UriMatcher)

Example 63 with UriMatcher

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

the class Communication_Provider method onCreate.

@Override
public boolean onCreate() {
    AUTHORITY = getContext().getPackageName() + ".provider.communication";
    sUriMatcher = new UriMatcher(UriMatcher.NO_MATCH);
    sUriMatcher.addURI(Communication_Provider.AUTHORITY, DATABASE_TABLES[0], CALLS);
    sUriMatcher.addURI(Communication_Provider.AUTHORITY, DATABASE_TABLES[0] + "/#", CALLS_ID);
    sUriMatcher.addURI(Communication_Provider.AUTHORITY, DATABASE_TABLES[1], MESSAGES);
    sUriMatcher.addURI(Communication_Provider.AUTHORITY, DATABASE_TABLES[1] + "/#", MESSAGES_ID);
    callsProjectionMap = new HashMap<String, String>();
    callsProjectionMap.put(Calls_Data._ID, Calls_Data._ID);
    callsProjectionMap.put(Calls_Data.TIMESTAMP, Calls_Data.TIMESTAMP);
    callsProjectionMap.put(Calls_Data.DEVICE_ID, Calls_Data.DEVICE_ID);
    callsProjectionMap.put(Calls_Data.TYPE, Calls_Data.TYPE);
    callsProjectionMap.put(Calls_Data.DURATION, Calls_Data.DURATION);
    callsProjectionMap.put(Calls_Data.TRACE, Calls_Data.TRACE);
    messageProjectionMap = new HashMap<String, String>();
    messageProjectionMap.put(Messages_Data._ID, Messages_Data._ID);
    messageProjectionMap.put(Messages_Data.TIMESTAMP, Messages_Data.TIMESTAMP);
    messageProjectionMap.put(Messages_Data.DEVICE_ID, Messages_Data.DEVICE_ID);
    messageProjectionMap.put(Messages_Data.TYPE, Messages_Data.TYPE);
    messageProjectionMap.put(Messages_Data.TRACE, Messages_Data.TRACE);
    return true;
}
Also used : UriMatcher(android.content.UriMatcher)

Example 64 with UriMatcher

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

the class Linear_Accelerometer_Provider method onCreate.

@Override
public boolean onCreate() {
    AUTHORITY = getContext().getPackageName() + ".provider.accelerometer.linear";
    sUriMatcher = new UriMatcher(UriMatcher.NO_MATCH);
    sUriMatcher.addURI(Linear_Accelerometer_Provider.AUTHORITY, DATABASE_TABLES[0], ACCEL_DEV);
    sUriMatcher.addURI(Linear_Accelerometer_Provider.AUTHORITY, DATABASE_TABLES[0] + "/#", ACCEL_DEV_ID);
    sUriMatcher.addURI(Linear_Accelerometer_Provider.AUTHORITY, DATABASE_TABLES[1], ACCEL_DATA);
    sUriMatcher.addURI(Linear_Accelerometer_Provider.AUTHORITY, DATABASE_TABLES[1] + "/#", ACCEL_DATA_ID);
    accelDeviceMap = new HashMap<String, String>();
    accelDeviceMap.put(Linear_Accelerometer_Sensor._ID, Linear_Accelerometer_Sensor._ID);
    accelDeviceMap.put(Linear_Accelerometer_Sensor.TIMESTAMP, Linear_Accelerometer_Sensor.TIMESTAMP);
    accelDeviceMap.put(Linear_Accelerometer_Sensor.DEVICE_ID, Linear_Accelerometer_Sensor.DEVICE_ID);
    accelDeviceMap.put(Linear_Accelerometer_Sensor.MAXIMUM_RANGE, Linear_Accelerometer_Sensor.MAXIMUM_RANGE);
    accelDeviceMap.put(Linear_Accelerometer_Sensor.MINIMUM_DELAY, Linear_Accelerometer_Sensor.MINIMUM_DELAY);
    accelDeviceMap.put(Linear_Accelerometer_Sensor.NAME, Linear_Accelerometer_Sensor.NAME);
    accelDeviceMap.put(Linear_Accelerometer_Sensor.POWER_MA, Linear_Accelerometer_Sensor.POWER_MA);
    accelDeviceMap.put(Linear_Accelerometer_Sensor.RESOLUTION, Linear_Accelerometer_Sensor.RESOLUTION);
    accelDeviceMap.put(Linear_Accelerometer_Sensor.TYPE, Linear_Accelerometer_Sensor.TYPE);
    accelDeviceMap.put(Linear_Accelerometer_Sensor.VENDOR, Linear_Accelerometer_Sensor.VENDOR);
    accelDeviceMap.put(Linear_Accelerometer_Sensor.VERSION, Linear_Accelerometer_Sensor.VERSION);
    accelDataMap = new HashMap<String, String>();
    accelDataMap.put(Linear_Accelerometer_Data._ID, Linear_Accelerometer_Data._ID);
    accelDataMap.put(Linear_Accelerometer_Data.TIMESTAMP, Linear_Accelerometer_Data.TIMESTAMP);
    accelDataMap.put(Linear_Accelerometer_Data.DEVICE_ID, Linear_Accelerometer_Data.DEVICE_ID);
    accelDataMap.put(Linear_Accelerometer_Data.VALUES_0, Linear_Accelerometer_Data.VALUES_0);
    accelDataMap.put(Linear_Accelerometer_Data.VALUES_1, Linear_Accelerometer_Data.VALUES_1);
    accelDataMap.put(Linear_Accelerometer_Data.VALUES_2, Linear_Accelerometer_Data.VALUES_2);
    accelDataMap.put(Linear_Accelerometer_Data.ACCURACY, Linear_Accelerometer_Data.ACCURACY);
    accelDataMap.put(Linear_Accelerometer_Data.LABEL, Linear_Accelerometer_Data.LABEL);
    return true;
}
Also used : UriMatcher(android.content.UriMatcher)

Example 65 with UriMatcher

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

the class Magnetometer_Provider method onCreate.

@Override
public boolean onCreate() {
    AUTHORITY = getContext().getPackageName() + ".provider.magnetometer";
    sUriMatcher = new UriMatcher(UriMatcher.NO_MATCH);
    sUriMatcher.addURI(Magnetometer_Provider.AUTHORITY, DATABASE_TABLES[0], SENSOR_DEV);
    sUriMatcher.addURI(Magnetometer_Provider.AUTHORITY, DATABASE_TABLES[0] + "/#", SENSOR_DEV_ID);
    sUriMatcher.addURI(Magnetometer_Provider.AUTHORITY, DATABASE_TABLES[1], SENSOR_DATA);
    sUriMatcher.addURI(Magnetometer_Provider.AUTHORITY, DATABASE_TABLES[1] + "/#", SENSOR_DATA_ID);
    sensorDeviceMap = new HashMap<String, String>();
    sensorDeviceMap.put(Magnetometer_Sensor._ID, Magnetometer_Sensor._ID);
    sensorDeviceMap.put(Magnetometer_Sensor.TIMESTAMP, Magnetometer_Sensor.TIMESTAMP);
    sensorDeviceMap.put(Magnetometer_Sensor.DEVICE_ID, Magnetometer_Sensor.DEVICE_ID);
    sensorDeviceMap.put(Magnetometer_Sensor.MAXIMUM_RANGE, Magnetometer_Sensor.MAXIMUM_RANGE);
    sensorDeviceMap.put(Magnetometer_Sensor.MINIMUM_DELAY, Magnetometer_Sensor.MINIMUM_DELAY);
    sensorDeviceMap.put(Magnetometer_Sensor.NAME, Magnetometer_Sensor.NAME);
    sensorDeviceMap.put(Magnetometer_Sensor.POWER_MA, Magnetometer_Sensor.POWER_MA);
    sensorDeviceMap.put(Magnetometer_Sensor.RESOLUTION, Magnetometer_Sensor.RESOLUTION);
    sensorDeviceMap.put(Magnetometer_Sensor.TYPE, Magnetometer_Sensor.TYPE);
    sensorDeviceMap.put(Magnetometer_Sensor.VENDOR, Magnetometer_Sensor.VENDOR);
    sensorDeviceMap.put(Magnetometer_Sensor.VERSION, Magnetometer_Sensor.VERSION);
    sensorDataMap = new HashMap<String, String>();
    sensorDataMap.put(Magnetometer_Data._ID, Magnetometer_Data._ID);
    sensorDataMap.put(Magnetometer_Data.TIMESTAMP, Magnetometer_Data.TIMESTAMP);
    sensorDataMap.put(Magnetometer_Data.DEVICE_ID, Magnetometer_Data.DEVICE_ID);
    sensorDataMap.put(Magnetometer_Data.VALUES_0, Magnetometer_Data.VALUES_0);
    sensorDataMap.put(Magnetometer_Data.VALUES_1, Magnetometer_Data.VALUES_1);
    sensorDataMap.put(Magnetometer_Data.VALUES_2, Magnetometer_Data.VALUES_2);
    sensorDataMap.put(Magnetometer_Data.ACCURACY, Magnetometer_Data.ACCURACY);
    sensorDataMap.put(Magnetometer_Data.LABEL, Magnetometer_Data.LABEL);
    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