infrastructure library

The infrastructure library provide on-phone implementations of CAMS services like the SmartphoneDeploymentService deployment service and the SQLiteDataManager data manager.

This library also holds the two built-in sampling packages:

  • device - a sampling package for collecting information from the device hardware.
  • sensors - a sampling package for collecting data from the basic phone sensors:

In terms of Domain-Driven Design (DDD), "the infrastructure layer is responsible for providing technical services and resources to support the other layers. It can include databases, message brokers, web servers, cloud platforms, 3rd-party APIs, or any other external components that are required by the system. The infrastructure layer should be generic and adaptable, implementing the interfaces or abstractions that are defined by the domain layer." From Domain-Driven Design (DDD): A Guide to Building Scalable, High-Performance Systems by Roman Glushach.

Classes

AccelerationFeatures
A set of acceleration (non-gravitational) features collected over a specific sampling period.
AccelerometerFeaturesProbe
A probe collecting accelerometer data over a sampling period and calculates a set of features based on the samplings, as represented by a AccelerationFeatures data point.
AccelerometerProbe
A probe collecting raw data from the accelerometer.
AmbientLight
Ambient light intensity in Lux. Typically collected from the light sensor on the front of the phone.
BatteryProbe
The BatteryProbe listens to the hardware battery and collect a BatteryState every time the battery state changes. For example, battery level or charging mode.
BatteryState
Holds battery level and charging status collected from the phone.
ConsoleDataManager
A very simple data manager that just "uploads" the data to the console (i.e., prints it). Used mainly for testing and debugging purposes.
ConsoleDataManagerFactory
DeviceInformation
Holds basic information about the mobile device from where the data is collected.
DeviceProbe
A probe that collects the device info about this device.
DeviceSamplingPackage
FileDataManager
Stores Measurement objects on the device's local storage media. Supports compression (zip) and encryption.
FileDataManagerEvent
A status event for this file data manager. See FileDataManagerEventTypes for a list of possible event types.
FileDataManagerEventTypes
An enumeration of file data manager event types
FileDataManagerFactory
FileStudyProtocolManager
Retrieve and store StudyProtocol json definitions on the device's local file system.
FlutterLocalNotificationController
A NotificationController based on the flutter_local_notifications Flutter plugin.
FreeMemory
Holds information about free memory on the phone.
GyroscopeProbe
A probe collecting raw data from the gyroscope.
LightProbe
The LightProbe listens to the phone's light sensor typically located near the front camera. Every value is in the SI unit Lux and is stored in a AmbientLight object.
MagnetometerProbe
A probe collecting raw data from the magnetometer.
MemoryProbe
A probe that collects free virtual memory on a regular basis as specified in PeriodicMeasure.frequency.
PedometerProbe
The pedometer probe listens to the hardware step counter sensor.
Persistence
A persistence layer that knows how to persistently store deployment and app task information across app restart.
ScreenEvent
Holds a screen event collected from the phone.
ScreenProbe
A probe collecting screen events:
SensorProbe
An abstract sensor probe used by all sensor probes to get the samplingPeriod.
SensorSamplingPackage
SmartphoneDeploymentService
A local (in-memory) implementation of a DeploymentService useful in CAMS studies to be deployed locally on this phone.
SQLiteDataManager
Stores meta data about the running SmartphoneDeployment and all collected Measurement json objects in an SQLite database on the device's local storage media.
SQLiteDataManagerFactory
Timezone
Holds timezone information about the mobile device.
TimezoneProbe
A probe that collects the device's current timezone.
UserAccelerometerProbe
A probe collecting raw data from the user accelerometer.

Functions

onDidReceiveNotificationResponse(NotificationResponse response) → void
Callback method called when a notification is clicked in the operating system.