This page contains an overview of all measure types available in sampling packages; both packages that are are built-in to the carp_mobile_sensing framework, as well as the external ones. This list is constantly evolving as we release more and more support.

Measure type format

The dataType property of a Measure specify what type of data to collect. The string version is typically a namespace + name. CAMS-native measure types have the namespace dk.cachet.carp and the name is the measure type:
dk.cachet.carp.<type>
The cachet part of the namespace is a legacy. The original vision and design of CARP was done as part of the Copenhagen Center for Health Technology (CACHET) and the namespace dk.cachet.carp was adopted back then. Now, CACHET has closed and the maintenance of CARP is now done by the Section of Digital Health at the Department of Health Technology at the Technical University of Denmark.For now we keep the old namespace for backward compatibility. This will, however, be changed to carp.dk in the future.
The different types is specified in the tables below.

Event-based vs. one-time measures

Most measures are event-based (EB), i.e., once triggered and started, they continuously sample data from their sensor until explicitly stopped. For example, collecting a step event every time a step is detected on the phone. However, some measures are one-time (OT), i.e., sampling one piece of data when triggered. For example, collecting weather data from the Open Weather API. It is important to know the type (EB vs. OT) of a measure since an event-based measure can be started and run until stopped, whereas a one-time measure needs to be triggered to sample data. This can, for example, be done periodically using appropriate triggers, like the PeriodicTrigger. The difference when specifying the study protocol is illustrated below. The first task added to the protocol contains a one-time measure (device info), which is triggered only once. The second task contains a set of event-based measures that are triggered to start immediately and keep sampling data based on events. The third task collects weather (one-time measure) periodically every 5 minutes.
  // Collect device info only once, when this study is deployed.
  protocol.addTaskControl(
    OneTimeTrigger(),
    BackgroundTask(
        measures: [Measure(type: DeviceSamplingPackage.DEVICE_INFORMATION)]),
    phone,
  );

  // Immediately start collecting step count, ambient light, screen activity, and
  // battery level events. All event-based measures.
  protocol.addTaskControl(
    ImmediateTrigger(),
    BackgroundTask(measures: [
      Measure(type: SensorSamplingPackage.STEP_EVENT),
      Measure(type: SensorSamplingPackage.AMBIENT_LIGHT),
      Measure(type: DeviceSamplingPackage.SCREEN_EVENT),
      Measure(type: DeviceSamplingPackage.BATTERY_STATE),
    ]),
    phone,
  );

  // Add a background task that collects weather every 5 minutes.
  protocol.addTaskControl(
      PeriodicTrigger(period: Duration(minutes: 5)),
      BackgroundTask(
          measures: [Measure(type: ContextSamplingPackage.WEATHER)]),
      weatherService);
Each SamplingPackage provides a list of what types of measures it supports using the dataTypes property. Each sampling package also comes with a default sampling schema for each of its measure types.

Available measure types

CAMS comes with a large set of predefined measure types, each available in different sampling packages. Some measures are part of CAMS, others are available in separate sampling packages, and some are part of device-specific sampling packages. The tables below describe, for each measure:
  • Type Name - all type names are of the format dk.cachet.carp.<type>, where type is listed below
  • Availability on Android and/or iOS
  • The sampling package containing the measure
  • A description
Measures marked with * are one-time measures.

Built-in sampling packages

TypeAndroid/iOSPackageDescription
acceleration+ +sensorsRate of change in velocity in x, y, z - including gravity
nongravitational acceleration+ +sensorsRate of change in velocity in x, y, z, - excluding gravity
acceleration features+ +sensorsAcceleration events over a specific sampling period and calculates higher-order features
rotation+ +sensorsRotation of the device in x, y, z (typically measured by a gyroscope)
magneticfield+ +sensorsMagnetic field around the device in x,y,z (typically measured by a magnetometer)
stepevent+ +sensorsStep events from the device on-board sensor
ambientlight+ -sensorsAmbient light from the phone’s front light sensor
deviceinformation*+ +deviceBasic device information
application information*+ +deviceInformation about the app
batterystate+ +deviceBattery charging status and battery level
screenevent+ -deviceScreen events (on/off/unlock)
applifecycleevent+ +deviceApp lifecycle state events (inactive, hidden, paused, resumed, detached)
freememory+ -deviceFree memory
timezone*+ +deviceTimezone of the device
heartbeat+ +deviceA heartbeat measurement every 15 minutes (default) telling if the app is running (and not killed by the OS)

External sampling packages

TypeAndroid/iOSPackageDescription
location+ +contextListens to the stream of location changes from the phone’s OS
activity+ +contextActivity as events from the OS’s build-in activity recognition API
weather*+ +contextDetailed weather information for the current location of the phone
airquality*+ +contextAir quality of the current location of the phone (from land-based stations)
geofence+ +contextTracking entry, dwell, and exit event in circular geofences
mobility+ +contextTrack location and calculates mobility features based on the mobility_features plugin
bluetooth+ +connectivityScanning nearby BLE devices
wifi+ -connectivityCollects SSID and BSSID from connected wifi networks
connectivity+ +connectivityConnectivity status events
beacon+ +connectivityScans for nearby iBeacons
audio*+ +mediaRecords audio from the device microphone
noise+ +mediaDetects ambient noise from the device microphone
apps*+ -appsList of installed apps
appusage*+ -appsList of app usage
phonelog*+ -communicationLog of phone calls in/out
textmessagelog*+ -communicationLog of text messages (sms) in/out
textmessage+ -communicationText message (sms) events when received
calendar*+ +communicationCollects calendar events from the calendars on the phone
survey*+ +surveyCollects data from surveys (questionnaires) via the Research Package and cognitive assessments from the Cognition Package

Wearable device sampling packages

TypeAndroid/iOSPackageDescription
health+ +healthCollects different types of health data from Apple Health and Google Health Connect that may come from connected wearable devices
movisens+ -movisensActivity and Heart Rate Monitoring using the Movisens Move4 and EcgMove4 devices
esense+ +esenseInertial measurement unit (IMU) sensor events and button press/release events from the eSense device
polar+ +polarInertial measurement (accelerometer, gyroscope, magnetometer) and heart rate (ECG, PPI, PPG, HR) data from the Polar devices
movesense+ +movesenseState (tap), heart rate (HR), ECG, and Inertial Movement Unit (IMU - accelerometer, gyroscope, magnetometer) data from the Movesense devices
Each of these device measures has sub-types, such as dk.cachet.carp.movisens.hr for heart rate (HR) measures from the Movisens device.