You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+5-6Lines changed: 5 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,18 +3,19 @@
3
3
This repo contains the source code for Flutter first-party plugins maintained by the [Copenhagen Research Platform (CARP)](http://www.carp.dk/) team at the Technical University of Denmark.
4
4
Check the `packages` directory for all plugins.
5
5
6
-
Flutter plugins enable access to platform-specific APIs using a platform channel.
6
+
Flutter plugins enable access to platform-specific APIs using a platform channel.
7
7
For more information about plugins and how to use them, see
|[app_usage](./packages/app_usage)| Track usage of all applications on phone. | ✔️ | ❌ |[](https://pub.dartlang.org/packages/app_usage)|
20
21
|[weather](./packages/weather)| Get current weather, as well as forecasting using the OpenWeatherMap API. | ✔️ | ✔️ |[](https://pub.dartlang.org/packages/weather)|
@@ -35,9 +36,7 @@ Please check existing issues and file any new issues, bugs, or feature requests
35
36
36
37
## Contributing
37
38
38
-
As part of the open-source Flutter ecosystem, we would welcome any help in maintaining and enhancing these plugins.
39
+
As part of the open-source Flutter ecosystem, we would welcome any help in maintaining and enhancing these plugins.
39
40
We (i.e., the CARP team) have limited resources for maintaining these plugins, and we rely on **your** help in this.
40
41
We welcome any contribution - from small error corrections in the documentation, to bug fixes, to large feature enhancements, or even new features in a plugin.
41
42
If you wish to contribute to any of the plugins in this repo, please review our [contribution guide](https://github.com/cph-cachet/flutter-plugins/CONTRIBUTING.md) and send a [pull request](https://github.com/cph-cachet/flutter-plugins/pulls).
Copy file name to clipboardExpand all lines: packages/empatica_e4link/README.md
+12-33Lines changed: 12 additions & 33 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,18 +1,15 @@
1
1
# Empatica Flutter plugin
2
2
3
-
Flutter plugin for the [Empatica E4](https://e4.empatica.com/e4-wristband)
4
-
wristband on Android. iOS coming soon.
3
+
Flutter plugin for the [Empatica E4](https://e4.empatica.com/e4-wristband) wristband on Android.
5
4
6
5
## Install (Flutter)
7
6
8
-
Add `empatica_e4link` as a dependency in `pubspec.yaml` or run `flutter pub add
9
-
empatica_e4link`
7
+
Add `empatica_e4link` as a dependency in `pubspec.yaml` or run `flutter pub add empatica_e4link`
10
8
For help on adding as a dependency, view the [pubspec documenation](https://flutter.io/using-packages/).
11
9
12
10
## Android
13
11
14
-
The package uses your location and bluetooth to fetch data from the eSense ear plugs.
15
-
Therefore location tracking and bluetooth must be enabled.
12
+
The package uses bluetooth to fetch data from the E4 device. Therefore bluetooth usage must be declared. Since bluetooth also allow for locations tracking, location tracking permissions must also be declared.
16
13
17
14
Add the following entry to your `manifest.xml` file, in the Android project of your application:
18
15
@@ -24,35 +21,25 @@ Add the following entry to your `manifest.xml` file, in the Android project of y
Also make sure to obtain permissions in your app to use location and bluetooth.
28
-
See the example app on how to e.g. use the [`permission_handler`](https://pub.dev/packages/permission_handler) for this. Note that the plugin **does not** handle permissions - this has to be done on an app level.
24
+
Also make sure to obtain permissions in your app to use location and bluetooth. See the example app on how to e.g. use the [`permission_handler`](https://pub.dev/packages/permission_handler) for this. Note that the plugin **does not** handle permissions - this has to be done on an app level.
29
25
30
-
Set the Android compile and minimum SDK versions to `compileSdkVersion 33`,
31
-
and `minSdkVersion 28` respectively, inside the `android/app/build.gradle` file.
26
+
Set the Android compile and minimum SDK versions to `compileSdkVersion 33`, and `minSdkVersion 28` respectively, inside the `android/app/build.gradle` file.
32
27
33
28
## iOS
34
29
35
30
Due to compatibility issues with Empatica's SDK, the iOS implementation is not able to function with new CocoaPods and iPhone architectures.
36
31
37
32
## Usage
38
33
39
-
The Empatica E4 Flutter plugin has been designed to resemble the Android
40
-
Empatica API almost **1:1**. Hence, you should be able to recognize the names
41
-
of the different classes and class variables.
42
-
For example, the methods on the `EmpaticaDeviceManager` class is mapped 1:1.
43
-
See the [Empatica Android documentation](https://developer.empatica.com/empatica-android-sdk-javadoc.zip) on how it all works.
34
+
The Empatica E4 Flutter plugin has been designed to resemble the Android Empatica API almost **1:1**. Hence, you should be able to recognize the names of the different classes and class variables. For example, the methods on the `EmpaticaDeviceManager` class is mapped 1:1. See the [Empatica Android documentation](https://developer.empatica.com/empatica-android-sdk-javadoc.zip) on how it all works.
44
35
45
-
However, one major design change has been done; this Empatica Flutter plugin complies to the Dart/Flutter reactive programming architecture using [Stream](https://api.dart.dev/dart-async/Stream-class.html)s.
46
-
Hence, you do not get callbacks to an Empatica device (as you do in Java) -- rather, you obtain a Dart stream and listen to this stream (and exploit all the [other very nice stream operations](https://dart.dev/tutorials/language/streams) which are available in Dart).
47
-
Below, we shall describe how to use the Empatica streams.
48
-
But first -- let's see how to set up and connect to an Empatica E4 device in the first place.
36
+
However, one major design change has been done; this Empatica Flutter plugin complies to the Dart/Flutter reactive programming architecture using [Stream](https://api.dart.dev/dart-async/Stream-class.html)s. Hence, you do not get callbacks to an Empatica device (as you do in Java) -- rather, you obtain a Dart stream and listen to this stream (and exploit all the [other very nice stream operations](https://dart.dev/tutorials/language/streams) which are available in Dart). Below, we shall describe how to use the Empatica streams. But first -- let's see how to set up and connect to an Empatica E4 device in the first place.
49
37
50
38
### Setting up and Connecting to an Empatica Device
51
39
52
40
All operations on the Empatica device happens via the `Empatica plugin`
53
41
54
-
At first one must connect to the Empatica backend via an API key given by
55
-
Empatica using the `authenticateWithAPIKey` method.
42
+
At first one must connect to the Empatica backend via an API key given by Empatica using the `authenticateWithAPIKey` method.
Everything with the Empatica API happens asynchronously. Hence, the `connectDevice` call merely initiates the connection
89
-
process. In order to know the status of the device manager, you should listen to
90
-
status events `statusEventSink`.
75
+
Everything with the Empatica API happens asynchronously. Hence, the `connectDevice` call merely initiates the connection process. In order to know the status of the device manager, you should listen to status events `statusEventSink`.
91
76
This is done via the `statusEventSink` stream.
92
-
Note, that if you want to know if your connection to the device is successful, you should initiate listening
93
-
**before** the connection is initiated, as shown above.
77
+
Note, that if you want to know if your connection to the device is successful, you should initiate listening **before** the connection is initiated, as shown above.
94
78
95
79
### Listen to physiological data
96
80
97
-
When the status is `CONNECTED` the device will be sending all data events to
98
-
`dataEventSink`. To get _ALL_ data one should start listening on this stream
99
-
before it is connected, e.g. when the status is `CONNECTING`.
81
+
When the status is `CONNECTED` the device will be sending all data events to `dataEventSink`. To get _ALL_ data one should start listening on this stream before it is connected, e.g. when the status is `CONNECTING`.
100
82
101
83
```dart
102
84
deviceManager.dataEventSink?.listen((event) {
@@ -120,7 +102,4 @@ The possible data events in the `dataEventSink` are:
120
102
121
103
## Contributing
122
104
123
-
### Android
124
-
125
-
The Gradle task useAar in ./android has to be run for the Empatica SDK to be
126
-
modeled and used in the Android code.
105
+
The Gradle task useAar in `./android` has to be run for the Empatica SDK to be modeled and used in the Android code.
0 commit comments