infrastructure library

The CAMS infrastructure layer: on-phone implementations of the CAMS services.

Holds the local deployment service (SmartphoneDeploymentService), the data managers that store measurements on the phone (ConsoleDataManager, FileDataManager, SQLiteDataManager), the FileStudyProtocolManager, the FlutterLocalNotificationManager, and the PersistenceService that saves runtime state across app restarts. These classes implement the interfaces defined in the domain layer and are used by the runtime layer. The built-in sampling packages are in the sampling_packages library.

Classes

BackgroundService
Keeps data collection running while the app is in the background on Android.
ConsoleDataManager
A data manager that prints each Measurement as JSON to the console.
ConsoleDataManagerFactory
Creates a ConsoleDataManager for data endpoints of type DataEndPointTypes.PRINT.
FileDataManager
A data manager that writes Measurements as JSON to files on the phone.
FileDataManagerEvent
A status event from a FileDataManager, carrying the path of the file it concerns.
FileDataManagerEventTypes
The event types used in FileDataManagerEvent, in addition to those in DataManagerEventTypes.
FileDataManagerFactory
Creates a FileDataManager for data endpoints of type DataEndPointTypes.FILE.
FileStudyProtocolManager
A StudyProtocolManager that loads and saves SmartphoneStudyProtocols as JSON files on the phone.
FlutterLocalNotificationManager
A NotificationManager that shows local notifications using the flutter_local_notifications plugin.
PersistenceService
Stores running studies and the user task queue in a local SQLite database, so they survive an app restart.
Settings
Global settings for CAMS: logging level, app info, time zone, a user ID, and the file paths used to store data on the phone.
SmartphoneDeploymentService
A DeploymentService that runs locally on the phone and keeps deployments in memory.
SQLiteDataManager
A data manager that stores Measurements as JSON in a local SQLite database.
SQLiteDataManagerFactory
Creates a SQLiteDataManager for data endpoints of type DataEndPointTypes.SQLITE.

Enums

DebugLevel
The amount of logging done by CAMS, set in Settings.debugLevel.

Functions

debug(String message) → void
Logs a debug message to the console. Only logged if Settings.debugLevel is DebugLevel.debug and the Flutter app runs in debug mode (kDebugMode).
info(String message) → void
Logs an information message to the console. Only logged if Settings.debugLevel is DebugLevel.info or higher.
onDidReceiveNotificationResponse(NotificationResponse response) → void
Handles a tap on a notification shown by FlutterLocalNotificationManager.
warning(String message) → void
Logs a warning message to the console. Only logged if Settings.debugLevel is DebugLevel.warning or higher.