Within the 3rd semester, we, the Master's class Mobile, have the task of implementing a group project. Together we decided to implement this with Flutter. A Flutter Library, which can read different sensors and return them raw or interpreted.
https://github.com/hraschan/flutter_sensor_library
We also decided that there should be an "example app" for it, which presents the application of the library.
https://github.com/hraschan/flutter_sensor_library_app
Flutter
Since we all had little to no experience with Flutter before, Mario and Maximilian prepared a workshop that presented us with the basics and in which we jointly carried out the setup of the project.
Flutter itself is an open-souce framework from Google that is used to create natively compiled applications. With Flutter, there are many libraries for standard UI elements that are needed on Android or iOS. The framework can also be used for desktop web applications.
The framework is therefore primarily used for iOS and Android applications. The programming language "Dart" is used for development, which was also developed by Google.
What the library can do
The library offers various classes and method collections to be able to use the sensors of a mobile device. For most sensors, it is based on already existing libraries, processes them and, if desired, passes on the collected data to a Flutter app. In addition, the library also offers interpreted data or data combined from several sensors, such as the altitude metres, which are calculated from the current air pressure (barometer) and the air pressure at sea level.
The functionality can be called up via certain wrapper classes, depending on whether movement data (Movement), position data (Position) or environment data (Environment) are required. In addition, the native sensors can be called individually. It must always be specified in which time interval the respective class should return data.
With this simple code example, it can be queried every 2 seconds whether the device has moved forward in the last two seconds. By passing the Boolean (in this case true), it can be determined whether the current movement at the time of the query or the interpolated data since the last query should be returned.
The recording application
In order to simplify the use of the library, an example application was created to show the individual uses.