carp_apps_package 0.31.1 copy "carp_apps_package: ^0.31.1" to clipboard
carp_apps_package: ^0.31.1 copied to clipboard

outdated

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

example/lib/example.dart

import 'package:carp_core/carp_core.dart';
import 'package:carp_apps_package/apps.dart';
import 'package:carp_mobile_sensing/carp_mobile_sensing.dart';

/// This is a very simple example of how this sampling package is used with
/// CARP Mobile Sensing (CAMS).
/// NOTE, however, that the code below will not run.
/// See the documentation on how to use CAMS: https://github.com/cph-cachet/carp.sensing-flutter/wiki
void main() async {
  // register this sampling package before using its measures
  SamplingPackageRegistry().register(AppsSamplingPackage());

  // Create a study protocol
  StudyProtocol protocol = StudyProtocol(
    ownerId: 'owner@dtu.dk',
    name: 'Context Sensing Example',
  );

  // define which devices are used for data collection
  // in this case, its only this smartphone
  Smartphone phone = Smartphone();
  protocol.addMasterDevice(phone);

  // Add an automatic task that immediately starts collecting connectivity,
  // nearby bluetooth devices, and wifi information.
  protocol.addTriggeredTask(
      ImmediateTrigger(),
      AutomaticTask()
        ..addMeasures(SensorSamplingPackage().common.getMeasureList(
          types: [
            AppsSamplingPackage.APPS,
            AppsSamplingPackage.APP_USAGE,
          ],
        )),
      phone);
}
0
likes
0
points
475
downloads

Publisher

verified publishercachet.dk

Weekly Downloads

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

Homepage
Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

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

More

Packages that depend on carp_apps_package