AWARE is the core service of the framework. This class provides manufacturer’s information, it is responsible for keeping the currently active plugins and sensors alive, scheduling remote uploads of the data if required and activate/deactivate sensors and plugins of the framework. This service checks the status of all the active addons and sensors at 5-minute intervals.

Public functions

AWARE has a set of public functions that can be used to simplify plugins’ development.

  • Aware.setSetting( Context context, String key, Object value ): insert/update settings of the framework. Check the specific sensors pages for their settings keys and allowed values.
  • Aware.setSetting( Context context, String key, Object value, String package_name): insert/update settings of a plugin (referenced by the package_name variable). Check the specific plugin page for their setting keys and values.
  • Aware.getSetting( Context context, String key ): given the setting key, retrieve its value (always returns the value as a String). Check the specific sensors pages for their settings keys and allowed values.
  • Aware.getSetting( Context context, String key, String package_name ): given the setting key, retrieve its value (always returns the value as a String). Check the specific plugins pages for their settings keys.
  • Aware.stopPlugin ( Context context, String package_name ): turns OFF a plugin if it is installed.
  • Aware.startPlugin ( Context context, String package_name ): turn ON a plugin if it is installed. If already running, new plugin settings are applied.
  • Aware.startXXX( Context context ): Given a  sensor XXX, requests AWARE to start the sensor if not running, and applies new sensor settings. This also restarts the sensor if already running.
  • Aware.stopXXX( Context context ): Given a sensor XXX, requests AWARE to stop the sensor if it is running.
  • Aware.downloadPlugin (Context context, String package_name, boolean is_update ): Requests the download of a plugin given the package name from AWARE webservices if it is available on the dashboard or redirects the user to the Play Store.
  • Aware.getContextCard( Context context, String package_name ): Given a plugin’s package name, fetch the context card for reuse. Returns View for reuse to quickly build an application user interface.
  • Aware.is_watch(Context context): returns true if the device where AWARE is running is a watch, false otherwise.
  • Aware.getPluginName(Context context, String package_name): Given a plugin’s package name, retrieve the plugin’s user-friendly name.
  • Aware.joinStudy( Context context, String study_url ): Joins a given a study. The study URL is from AWARE’s study dashboard. This method fetches the study configuration and applies the settings on the client.
  • Aware.isStudy(Context context): returns true or false whether the device is enrolled in a study.
  • Aware.reset(Context context): makes a device quit a study and reset to the default client settings.
  • Aware.debug(Context c, String message): log a debug message into AWARE’s logs. Used for debugging overall framework and plugins functionality and performance.
  • Aware.getStudy(Context c, String study_url): returns a Cursor with the latest information of a given study by URL.

aware-broadcasts

  • Aware.ACTION_AWARE_DEVICE_INFORMATION: broadcasted when there is manufacturer device information available.
  • Aware.ACTION_AWARE_SYNC_DATA: received broadcast to backup data to AWARE Server in all active sensors and plugins.
  • Aware.ACTION_AWARE_CLEAR_DATA: received broadcast to clear the stored data from all active sensors and plugins locally and, if enrolled in a study, removes all the data remotely.
  • Aware.ACTION_AWARE_CURRENT_CONTEXT: received broadcast to request from all the sensors and plugins the users’ most up-to-date context.
  • Aware.ACTION_AWARE_STOP_PLUGINS: asks all plugins to stop.
  • Aware.ACTION_AWARE_STOP_SENSORS: asks all sensors to stop.
  • Aware.ACTION_AWARE_PLUGIN_INSTALLED: broadcasted when a plugin is installed.
    • extra_plugin: string with the package name of the installed plugin.
  • Aware.ACTION_AWARE_PLUGIN_UNINSTALLED: broadcasted when a plugin is removed.
    • extra_plugin: string with the package name of the removed plugin.
  • Aware.ACTION_QUIT_STUDY: this resets the device to default settings and quits any ongoing study.

aware-providers

Aware Device

Contains the manufacturer’s device information.

Aware_Device.CONTENT_URI
content://com.aware.provider.aware/aware_device

Table field Field type Description
_id INTEGER Primary key, auto incremented
timestamp REAL Unixtime milliseconds since 1970
device_id TEXT AWARE device UUID
board TEXT Manufacturer’s board name
brand TEXT Manufacturer’s brand name
device TEXT Manufacturer’s device name
build_id TEXT Android OS build ID
hardware TEXT Hardware codename
manufacturer TEXT Device’s manufacturer
model TEXT Device’s model
product TEXT Device’s product name
serial TEXT Manufacturer’s device serial, not unique
release TEXT Android’s release
release_type TEXT Android’s type of release (e.g., user, userdebug, eng)
sdk INTEGER Android’s SDK level

Aware Settings

Stores the framework’s and plugin’s settings.

Aware_Settings.CONTENT_URI
content://com.aware.provider.aware/aware_settings

Table field Field type Description
_id INTEGER Primary key, auto incremented
key TEXT Setting key
value TEXT Setting value
package_name TEXT The package name that this setting is used at.

Aware Plugins

Stores the information of available plugins and their statuses.

Aware_Plugins.CONTENT_URI
content://com.aware.provider.aware/aware_plugins

Table field Field type Description
_id INTEGER Primary key, auto incremented
package_name TEXT Plugin’s package name
plugin_name TEXT Plugin’s name
plugin_version TEXT Plugin’s version code, for detecting updates
plugin_status INTEGER Plugin’s status: 0 = disabled; 1 = active; 2 = updated; 3 = not installed
plugin_author TEXT Plugin’s author information
plugin_icon BLOB Plugin’s cached icon
plugin_description TEXT Plugin’s description

Aware Studies

Stores the information of enrolled studies.

Aware_Studies.CONTENT_URI
content://com.aware.provider.aware/aware_studies

Table field Field type Description
_id INTEGER Primary key, auto incremented
timestamp REAL Unixtime milliseconds since 1970
device_id TEXT AWARE device UUID
study_url TEXT The URL for the study, i.e., where the data is sent as POST
study_key TEXT Study ID
study_api TEXT Study API key
study_pi TEXT Researcher information
study_config TEXT Study configuration settings as a JSONArray
study_title TEXT Study title
study_description TEXT Study description (plain-text and HTML supported)
double_joined REAL timestamp of when participant joined the study
double_exit REAL timestamp of when the participant quit the study
study_compliance TEXT log of participant compliance (e.g., attempting to quit, uninstalling plugin, etc).

Aware Log

Stores debugging information of the client, sensors and plugin statuses.

Aware_Log.CONTENT_URI
content://com.aware.provider.aware/aware_log

Table field Field type Description
_id INTEGER Primary key, auto incremented
timestamp REAL Unixtime milliseconds since 1970
device_id TEXT AWARE device UUID
log_message TEXT Logged message (free form)
AWARE