Run it on your phone
Before anyone else sees your study, run it on your own phone. The app reads your files from its own folder, any sign-in works, and the data stays on the phone. No server and no account needed.
You need Flutter and a phone connected to your computer (or a simulator).
Run it
Section titled “Run it”-
Get the app.
Terminal window git clone https://github.com/carp-dk/carp_study_appcd carp_study_app -
Add your study. Put your files in
assets/carp/:File Folder Needed? protocol.jsonfrom Step 1assets/carp/resources/Yes consent.jsonfrom Step 1assets/carp/resources/No. Without it, there is nothing to sign. Translations, such as en.jsonandda.jsonassets/carp/lang/Only if your protocol or consent uses translation keys. en.jsonis the fallback.Messages for the Home tab, one .jsonfile eachassets/carp/messages/No These folders are ignored by git, so your study files are never committed to the app.
-
Run the app.
Terminal window flutter runA debug build runs in local mode by default.
-
Sign in with anything. Either sign-in option works. The app then shows one invitation, your study. Accept it, sign the consent, and the study starts.
-
Change something and run again. Local mode keeps nothing between runs, so after editing a file, stop the app and run
flutter runagain. You start fresh from sign-in.
Where is my data?
Section titled “Where is my data?”On the phone, in a SQLite database called carp-data.db. Each row in its measurements table is one measurement, with its data_type and the measurement as JSON. Files such as audio, video and photos are saved next to it, in carp/deployments/<deployment id>/data/ in the app’s documents folder.
Copy the database from a debug build to your computer:
adb exec-out run-as dk.cachet.carp_study_app cat databases/carp-data.db > carp-data.dbFiles are under app_flutter/carp/ in the same place:
adb exec-out run-as dk.cachet.carp_study_app ls -R app_flutter/carpcarp-data.db and the carp folder are in the app’s Documents folder. It is visible in the Files app, under On My iPhone → CARP Studies. On a Mac, connect the phone and open it in Finder → your iPhone → Files.
On the simulator, open the folder directly:
open "$(xcrun simctl get_app_container booted com.cachet.carpstudyapp data)/Documents"Then see what was collected:
sqlite3 carp-data.db "select data_type, count(*) from measurements group by 1"More about saving on the phone: Keep data on the phone.
Other modes
Section titled “Other modes”flutter run --dart-define="deployment-mode=dev" runs the same app against CARP’s dev server. The modes are local, dev, test and production. Release builds use production. See Go live.
Next: Go live