Data managers
Choose where CAMS stores or uploads collected measurements, and configure the data endpoint in a study protocol.
Set the dataEndPoint of a study protocol to choose where CAMS stores or uploads collected measurements. The available data managers and backends are:
| Data manager or backend | Typical use |
|---|---|
ConsoleDataManager | Debug output to the Dart console. |
FileDataManager | Local file persistence as JSON, optionally zipped. Configured with a FileDataEndPoint. |
SQLiteDataManager | Local structured storage in SQLite. Configured with a SQLiteDataEndPoint. |
FirebaseDataManager | Upload of JSON documents and files to Firebase services, through carp_firebase_backend. |
CarpDataManager | Streaming and synchronization of study data with CARP Web Services (CAWS), through carp_backend. |
To implement your own data manager, see Adding a new data manager.
Files
FileDataEndPoint saves measurements in a JSON file on the local device. Create the endpoint and add it to a study protocol:
CARP measurements are stored in this subfolder:
local_application_path is the folder where an application can place files that are private to the application. Data files follow the naming schema carp-data-yyyy-mm-dd-hh-mm-ss-ms.json. If the JSON file is zipped, .zip is added.
Flutter files are stored in the AppData directory, located in the data/data/<<package_name>>/app_flutter folder. You can access the files through Android Studio.
Files are stored in the NSDocumentsDirectory, the app's document folder on the phone. You can access this folder and its files through the macOS Finder when the phone is plugged into a computer.
Note
To access app files through Finder, set UIFileSharingEnabled to true in Info.plist (see Installation).
SQLite
SQLiteDataEndPoint works like the file endpoint, except that data is stored in an SQLite database instead of a file. The endpoint takes no configuration:
You can access the database files like other files (see Files). On Android, the SQLite database file is located in the data/data/<<package_name>>/databases folder.
Firebase
carp_firebase_backend is a separate Flutter package that supports Google Firebase as a backend. It uploads data both as files in Storage and as raw JSON in Firestore. The package includes its full documentation.
Warning
The Firebase data manager has not yet been updated to API level 2.x.
CARP Web Services (CAWS)
carp_backend is a separate Flutter package that supports the CARP Web Services (CAWS) backend. It supports:
- user authentication and setting up a connection to CAWS
- download of a study deployment configuration from CAWS
- streaming of sensing data from CAMS to CAWS
- upload and download of data, such as files and JSON documents, to and from CAWS
The package includes its full documentation. The CAMS Demo App shows how to use it.
Add CAWS as the data endpoint of a CAMS study protocol and configure it with a CarpDataEndPoint:
For an overview of where CARP data can be stored, see Data storage.