carp_apps_package 0.40.0 icon indicating copy to clipboard operation
carp_apps_package: ^0.40.0 copied to clipboard


Apps sampling package for the CARP Mobile Sensing framework (Android only).

CARP Apps Sampling Package #

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

  • apps - a list of installed apps on the phone.
  • app_usage - a log of app usage activity.

These measures are only available on Android.

See the wiki for further documentation, particularly on available measure types. See the CARP Mobile Sensing App for an example of how to build a mobile sensing app 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.

Installing #

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_apps_package: ^latest

Android Integration #

Edit your app's manifest.xml file such that it contains the following permission request:

<manifest xmlns:android=""

   <uses-permission android:name="android.permission.PACKAGE_USAGE_STATS" tools:ignore="ProtectedPermissions"/>
   <uses-permission android:name="android.permission.QUERY_ALL_PACKAGES" />

Starting with Android 11, Android applications targeting API level 30, wanting to list "external" applications have to declare a new "normal" permission in their AndroidManifest.xml file called QUERY_ALL_PACKAGES.

Starting from May 5 2021, Google will mark a breaking change on how applications requesting QUERY_ALL_PACKAGES are accepted in the Google Play. Quoting from the doc:

Permitted use involves apps that must discover any and all installed apps on the device, for awareness or interoperability purposes may have eligibility for the permission. Permitted use includes; device search, antivirus apps, file managers, and browsers.

Apps granted access to this permission must comply with the User Data policies, including the Prominent Disclosure and Consent requirements, and may not extend its use to undisclosed or invalid purposes.

More info here:

iOS Integration #

Not supported.

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_apps_package/apps.dart';

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

pub points


verified publisher

Apps sampling package for the CARP Mobile Sensing framework (Android only).



API reference


Icon for licenses.MIT (LICENSE)


app_usage, carp_core, carp_mobile_sensing, carp_serializable, device_apps, flutter, json_annotation, permission_handler


Packages that depend on carp_apps_package