carp_esense_package 0.1.4

  • Readme
  • Changelog
  • Installing
  • 48

CARP eSense Sampling Package #

pub package

This library contains a sampling package for the carp_mobile_sensing framework to work with the eSense earable computing platform. This packages supports sampling of the following Measure types(s)

  • esense_button : eSense button pressed / released events
  • esense_sensor : eSense sensor (accelerometer & gyroscope) events.

See the user documentation on the eSense device for how to use the device. See the esense_flutter Flutter plugin and its API documentation to understand how sensor data is generated and their data formats.

See the carp_mobile_sensing wiki for further documentation, particularly on available measure types and sampling schemas.

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.

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_mobile_sensing: ^0.6.0
  carp_esense_package: ^0.1.2

Android Integration #

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

<uses-permission android:name="android.permission.BLUETOOTH"/>
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-feature android:name="android.hardware.bluetooth_le" android:required="true"/>

NOTE: The first time the app starts, make sure to allow it to access the phone location. This is necessary to use the BLE on Android.

NOTE: This package only supports AndroidX and hence requires any Android app using this plugin to also migrate if they're using the original support library. See Flutter AndroidX compatibility

iOS Integration #

Requires iOS 10 or later. Hence, in your Podfile in the ios folder of your app, make sure that the platform is set to 10.0.

platform :ios, '10.0'

Add this permission in the Info.plist file located in ios/Runner:

<string>Uses bluetooth to connect to the eSense device</string>

Using it #

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

import 'package:carp_mobile_sensing/carp_mobile_sensing.dart';
import 'package:carp_esense_package/esense.dart';

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


0.1.3 #

  • alignment with carp_mobile_sensing v. 0.6.1.

0.1.2 #

  • upgrade to use the esense_flutter plugin instead of the deprecated esense plugin.

0.1.0 #

  • initial release

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:

  carp_esense_package: ^0.1.4

2. Install it

You can install packages from the command line:

with Flutter:

$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

import 'package:carp_esense_package/esense.dart';
import 'package:carp_esense_package/esense.g.dart';
import 'package:carp_esense_package/esense_domain.dart';
import 'package:carp_esense_package/esense_package.dart';
import 'package:carp_esense_package/esense_runtime.dart';
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

We analyzed this package on Dec 13, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.6.1
  • pana: 0.13.1+4
  • Flutter: 1.12.13+hotfix.2

Health suggestions

Fix lib/esense.dart. (-1 points)

Analysis of lib/esense.dart reported 2 hints:

line 5 col 8: Unused import: 'dart:math'.

line 8 col 8: Unused import: 'package:flutter/services.dart'.

Format lib/esense_domain.dart.

Run flutter format to format lib/esense_domain.dart.

Format lib/esense_package.dart.

Run flutter format to format lib/esense_package.dart.

Format lib/esense_runtime.dart.

Run flutter format to format lib/esense_runtime.dart.

Maintenance suggestions

Maintain an example. (-10 points)

Create a short demo in the example/ directory to show how to use this package.

Common filename patterns include main.dart, example.dart, and carp_esense_package.dart. Packages with multiple examples should provide example/

For more information see the pub package layout conventions.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.3.0 <3.0.0
carp_mobile_sensing ^0.6.2 0.6.2
esense_flutter ^0.2.0 0.2.0+2
flutter 0.0.0
json_annotation ^3.0.0 3.0.0
Transitive dependencies
app_usage 0.1.0
archive 2.0.11
args 1.5.2
async 2.4.0
battery 0.3.1+6
charcode 1.1.2
collection 1.14.11 1.14.12
connectivity 0.4.6+1
convert 2.1.1
crypto 2.1.4
device_apps 1.0.9
device_info 0.4.1+4
file_utils 0.1.3
fixnum 0.10.11
flutter_blue 0.6.2 0.6.3+1
globbing 0.3.0
light 0.1.1
meta 1.1.8
path 1.6.4
path_provider 1.5.1
pedometer 1.0.0
permission_handler 4.0.0
platform 2.2.1
protobuf 0.14.4 1.0.1
rxdart 0.22.6 0.23.1
screen_state 0.1.1
sensors 0.4.1+5
sky_engine 0.0.99
stats 0.2.0+3
system_info 0.1.1
typed_data 1.1.6
uuid 2.0.4
vector_math 2.0.8
Dev dependencies
build_runner any
json_serializable ^3.0.0
test any