Skip to content

Keep data on the phone

This is the simplest option: no server, no accounts, no internet. Measurements are saved in the app’s private storage on the phone.

Where data goes is decided by a single setting in the study protocol, the data endpoint. Local storage, CAWS and your own server differ only in this setting. The rest of the protocol (what to collect, and when) stays the same.

For local storage, pick one of two endpoints:

Endpoint Saves data as Good for
SQLiteDataEndPoint() A small database on the phone Apps that show the data back, e.g. “your steps this week”
FileDataEndPoint() Text files (JSON), zipped Handing the data to a researcher

The protocol from Step 1 already uses SQLiteDataEndPoint(). To save files instead, change only that line:

final protocol = SmartphoneStudyProtocol(
name: 'My first study',
dataEndPoint: FileDataEndPoint(),
);

The data lives in the app’s private folder:

  • Database: carp-data, in the app’s databases folder.
  • Files: carp/deployments/<deployment id>/data/, in the app’s documents folder.

To copy it to your computer:

  • Android: in Android Studio, open Device Explorer and go to data/data/<your app id>/. The database is in databases/, files in app_flutter/carp/.
  • iPhone: add UIFileSharingEnabled = YES to Info.plist, plug the phone into a Mac, and open it in Finder → Files.

Local storage is perfect for trying things out. For a real study you usually want data to arrive centrally without touching each phone. Then look at CAWS or your own server.

More detail: Data Managers.