Skip to content

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).

  1. Get the app.

    Terminal window
    git clone https://github.com/carp-dk/carp_study_app
    cd carp_study_app
  2. Add your study. Put your files in assets/carp/:

    File Folder Needed?
    protocol.json from Step 1 assets/carp/resources/ Yes
    consent.json from Step 1 assets/carp/resources/ No. Without it, there is nothing to sign.
    Translations, such as en.json and da.json assets/carp/lang/ Only if your protocol or consent uses translation keys. en.json is the fallback.
    Messages for the Home tab, one .json file each assets/carp/messages/ No

    These folders are ignored by git, so your study files are never committed to the app.

  3. Run the app.

    Terminal window
    flutter run

    A debug build runs in local mode by default.

  4. 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.

  5. Change something and run again. Local mode keeps nothing between runs, so after editing a file, stop the app and run flutter run again. You start fresh from sign-in.

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:

Terminal window
adb exec-out run-as dk.cachet.carp_study_app cat databases/carp-data.db > carp-data.db

Files are under app_flutter/carp/ in the same place:

Terminal window
adb exec-out run-as dk.cachet.carp_study_app ls -R app_flutter/carp

Then see what was collected:

Terminal window
sqlite3 carp-data.db "select data_type, count(*) from measurements group by 1"

More about saving on the phone: Keep data on the phone.

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