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
- BackgroundService
- A service for managing background execution on Android.
- 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
- FileDataManager
-
Stores
Measurementobjects 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
StudyProtocoljson definitions on the device's local file system. - FlutterLocalNotificationManager
- A NotificationManager based on the flutter_local_notifications Flutter plugin.
- PersistenceService
- The PersistenceService class is a singleton which handles persistence of study runtime information to a SQLite database on the phone. Used to store information across app re-start on:
- Settings
- Handle settings for the CAMS infrastructure. This includes settings for debugging, file paths, and other settings related to the infrastructure layer.
- SmartphoneDeploymentService
-
A local (in-memory) implementation of a
DeploymentServiceuseful in CAMS studies to be deployed locally on this phone. - SQLiteDataManager
-
Stores all collected
Measurementjson objects in an SQLite database on the device's local storage media. Measurements are stored in themeasurementstable. - SQLiteDataManagerFactory
Enums
- DebugLevel
- Debugging levels.
Functions
-
debug(
String message) → void - Add a debug messages to the system log. Only logged if the Flutter app is in debug mode (kDebugMode).
-
info(
String message) → void - Add an information messages to the system log.
-
onDidReceiveNotificationResponse(
NotificationResponse response) → void - Callback method called when a notification is clicked in the operating system.
-
warning(
String message) → void - Add a warning messages to the system log.