| Layer | Main responsibility |
|---|---|
| Runtime | The main runtime layer of CAMS - orchestrates the client manager with study controllers, device managers, controllers, and registries. |
| Infrastructure | Provides different services for deployment, background sensing, persistence, data management, and sampling packages. |
| Plugins | A set of Flutter plugins used by CAMS for accessing the operating system (OS), online services, and connected BLE devices on Android and iOS. |
Runtime
The runtime layer is the main entry point to CAMS and holds the client manager, study controllers for each running study, device managers, and a set of controllers and registries.| Component | Role |
|---|---|
| SmartPhone ClientManager * | The main entry point to CAMS. The client manager holds references to its deployment service, the device controller, and the client repository, which again holds the set of running studies. |
| Smartphone StudyController | A study controller is created for each study added to the client manager’s repository. The study controller is responsible for handling the study on runtime. It collects data via its deployment executor and sends it to to its data manager for storage or upload. |
| DeviceController * | Controls all primary and connected devices during runtime. For each device available on the phone, there is a DeviceManager for it, such as the SmartphoneDeviceManager. |
| DataManagerRegistry * | Registry of available DataManager implementations. |
| AppTaskController * | Manages AppTask lifecycle and queueing. |
| NotificationManager * | Handles OS-level notifications. |
| SamplingPackage Registry * | Registry of available SamplingPackage implementations. |
| DataTransformer SchemaRegistry * | Registry of available DataTransformerSchema mappings. |
The SmartPhone ClientManager is configured by specifying deployment service, device controller, and runtime options.
Studies can be added, which creates and hosts a SmartphoneStudyController per study.
A study can be deployed. This entails that the study deployment is fetched from the deployment service and added to the study controller. The study deployment described what data to collect and which data manager to use for data upload and/or transformation.
Infrastructure
The infrastructure layer holds a set of services for getting study deployments, collecting data, and storing it. The most important part is the set of sampling packages, which are described in more details in this scientific paper.| Component | Role |
|---|---|
| DeploymentService | Handles study deployment configurations for the client. CAMS comes with a build-in SmartphoneDeploymentService (default) which are used for apps that only runs local deployments. The CarpDeploymentService is an CAWS-specific implementation of theDeploymentService interface. |
| DataManager | Data Managers know how to store, save, or upload data, such as the SQLiteDataManager or the CarpDataManager. |
| SamplingPackage | A sampling package contains support for data collection of measures on specific device. |