Skip to content

Install eSense

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

dependencies:
flutter:
sdk: flutter
carp_core: ^latest
carp_mobile_sensing: ^latest
carp_esense_package: ^latest
...

The package uses bluetooth to fetch data from the eSense earplugs. Therefore permission to access bluetooth must be enabled on both Android and iOS, as follows. Then make sure to obtain permissions in your app to use bluetooth.

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

android/app/src/main/AndroidManifest.xml
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<uses-permission
android:name="android.permission.BLUETOOTH"
android:maxSdkVersion="30" />
<uses-permission
android:name="android.permission.BLUETOOTH_ADMIN"
android:maxSdkVersion="30" />
<uses-permission
android:name="android.permission.BLUETOOTH_SCAN"
android:usesPermissionFlags="neverForLocation" />
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT"/>
<application ...>
</manifest>

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.

ios/Podfile
platform :ios, '10.0'

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

ios/Runner/Info.plist
<plist version="1.0">
<dict>
...
<key>NSBluetoothAlwaysUsageDescription</key>
<string>Uses bluetooth to connect to the eSense device</string>
<key>UIBackgroundModes</key>
<array>
<string>bluetooth-central</string>
<string>bluetooth-peripheral</string>
<string>audio</string>
<string>external-accessory</string>
<string>fetch</string>
</array>
</dict>
</plist>