CARP Connectivity Sampling Package

pub package

This library contains a sampling package for connectivity sampling to work with the carp_mobile_sensing package. This packages supports sampling of the following Measure types:

  • dk.cachet.carp.wifi
  • dk.cachet.carp.connectivity
  • dk.cachet.carp.bluetooth

See the wiki for further documentation, particularly on available measure types and sampling schemas. There is privacy protection of wifi and bluetooth names as part of the default Privacy Schema.

For Flutter plugins for other CARP products, see CARP Mobile Sensing in Flutter.

If you're interested in writing you own sampling packages for CARP, see the description on how to extend CARP on the wiki.


To use this package, add the following to you pubspc.yaml file. Note that this package only works together with carp_mobile_sensing.

    sdk: flutter
  carp_core: ^latest
  carp_mobile_sensing: ^latest
  carp_connectivity_package: ^latest

Android Integration

As explained in the Android Wi-Fi scanning overview, access to wifi information required different permission to be set. For Android >= 10 (API level 29) it is ACCESS_FINE_LOCATION, ACCESS_COARSE_LOCATION and CHANGE_WIFI_STATE.

Add the following to your app's manifest.xml file located in android/app/src/main:

<manifest xmlns:android=""


    <!-- The following permissions are used in the Connectivity Package -->
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
    <uses-permission android:name="android.permission.CHANGE_WIFI_STATE"/>


iOS Integration

From iOS >= 13 there is no longer access to wifi information. See here form the Flutter description and here for the iOS description.

To enable bluetooth tracking, add these permissions in the Info.plist file located in ios/Runner:

<string>Bluetooth needed</string>

Using it

To use this package, import it into your app together with the carp_mobile_sensing package:

import 'package:carp_core/carp_core.dart';
import 'package:carp_mobile_sensing/carp_mobile_sensing.dart';
import 'package:carp_connectivity_package/connectivity.dart';

Before creating a study and running it, register this package in the SamplingPackageRegistry.



A library for collecting connectivity data on: