CAMS v. 0.40.x and Polar Device Integration Released

CARP Mobile Sensing

A new major release of CARP Mobile Sensing is now available (version 0.40.0). This release has a number of new and improved features:

  • Persistent sampling across app re-start – since the operating systems (Android and iOS) are increasingly killing apps when running in the background, there is now much better support for handling app re-start. This entails that the sampling state is persistently saved on the phone so that when the app restarts, it will resume sampling where it was killed. Of course, we can’t avoid gaps in sampling, when the OS kills the app, but at least sampling is resumed when the app is restarted.
  • Notification support – an important way to ensure that apps are restarted when a user needs to provide input (using an AppTask) is to use notifications on the phone. When the user clicks a notification, the OS will restart the app and redirect the user to the app. See the CAMS wiki section on how to create an AppTask and how to make use of notifications as part of this.
  • Study protocol improvements – the way the Study Protocol is configured has changed slightly to resemble the Study Protocol domain model in the newly released version 1.0.0 of the CARP Core Framework (Note, however, that CAMS is not yet updated to version 1.0.0 of CARP Core – this will happen in the next release). This entails that the way a Measure and SamplingSchema is configured has been changed.
  • SQLite support – CAMS now has built-in support for storing data in a SQLite database locally on the phone. This will replace/supplement the old File data endpoint, which has performance and scalability issues, once running large high-throughput sampling studies.

There are a few more minor changes – please check the ChangeLog on The CAMS wiki is also updated to reflect the changes and new features of this release.

Polar Device Integration

The carp_polar_package sampling package has been released. This package supports data collection from the Polar devices, more specifically;

Depending on the device, the following CAMS Measures are supported:

  • Accelerometer
  • Gyroscope
  • Magnetometer
  • Electrocardiogram (ECG)
  • Pulse-to-Pulse Interval (PPI)
  • Photoplethysmograpy (PPG)
  • Heart rate

The CARP Mobile Sensing App is updated to include a study protocol that uses the Polar devices. This is (as usual) specified in the local_study_protocol_mananger.dart file and looks like this:

    // define the Polar device and add its measures
    PolarDevice polar = PolarDevice(
      identifier: 'B5FC172F',
      name: 'Polar H10',
      polarDeviceType: PolarDeviceType.H10,
      roleName: 'polar-h10-device',


          ..addMeasure(Measure(type: PolarSamplingPackage.POLAR_HR))
          ..addMeasure(Measure(type: PolarSamplingPackage.POLAR_ECG))
          ..addMeasure(Measure(type: PolarSamplingPackage.POLAR_PPG))
          ..addMeasure(Measure(type: PolarSamplingPackage.POLAR_PPI)),