CARP Context Sampling Package
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
dependencies: flutter: sdk: flutter carp_mobile_sensing: ^0.3.0 carp_context_package: ^0.3.0 ...
Add the following to your app's
manifest.xml file located in
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="<your_package_name>" xmlns:tools="http://schemas.android.com/tools"> ... <!-- The following permissions are used for CARP Mobile Sensing --> <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> <uses-permission android:name="com.google.android.gms.permission.ACTIVITY_RECOGNITION" /> <uses-permission android:name="android.permission.PACKAGE_USAGE_STATS" tools:ignore="ProtectedPermissions"/> <application ... <!-- service for using the Android activity recognition API --> <service android:name="at.resiverbindet.activityrecognition.activity.ActivityRecognizedService" /> </application> </manifest>
Add this permission in the
Info.plist file located in
<key>NSLocationWhenInUseUsageDescription</key> <string>Uses the location API to record location.</string> <key>NSLocationAlwaysUsageDescription</key> <string>Uses the location API to record location.</string> <key>NSMotionUsageDescription</key> <string>Detects activity.</string> <key>UIBackgroundModes</key> <array> <string>fetch</string> <string>location</string> </array>
To use this package, import it into your app together with the
import 'package:carp_mobile_sensing/carp_mobile_sensing.dart'; import 'package:carp_context_package/context.dart';
Before creating a study and running it, register this package in the SamplingPackageRegistry.
- Built-in types and core primitives for a Flutter application. [...]
- Support for asynchronous programming, with classes such as Future and Stream. [...]
- Classes and utilities that supplement the collection support in dart:core. [...]
- Encoders and decoders for converting between different data representations, including JSON and UTF-8. [...]
- Built-in types, collections, and other core functionality for every Dart program. [...]
- Interact with developer tools such as the debugger and inspector. [...]
- Mathematical constants and functions, plus a random number generator. [...]
- Lists that efficiently handle fixed sized data (for example, unsigned 8 byte integers) and SIMD numeric types. [...]
- File, socket, HTTP, and other I/O support for non-web applications. [...]
- Concurrent programming using isolates: independent workers that are similar to threads but don't share memory, communicating only via messages. [...]