Writing a Bluetooth mobile app with Flutter
This year I’ve built a mobile app that connects to Urban Native’s product, the T9, a high-end electric scooter made entirely of titanium.
Initially, my role was to develop an internal mobile app for the team’s electrical engineer so he could consult data the scooter would emit periodically via Bluetooth, such as battery level, current speed, motor temperature, and more. Then we decided to transform the app into a consumer-facing app, to offer more possibilities to the consumers, such as fine-tuning their device’s settings and consulting battery consumption reports, and in the future, lock their devices securely with a password.
The first screen lets you to select your device, the second is a main page with a picture of the scooter and some info such as battery level. The scooter fades in the background as you scroll down to select a page. For the speed limiter, I reproduced the retro LED screen’s grid, to create a visual connection between the app and the physical device.
While Flutter and Dart were easy and fun to use, there were definitely some setbacks along the way.
- For one, when I started development, I chose Flutter because it had a popular, actively maintained Bluetooth library, FlutterBlue. However, at some point during development, the author stopped development and even stopped accepting pull requests. This coincided with the migration to Flutter 3, which FlutterBlue did not support.
- Another problem I had was that the code shrinking and obfuscation tool used on Android deleted parts of the Bluetooth library when building a release version. It was breaking my builds and I didn’t know why. This problem could be solved by adding proguard rules to the project, but it was hard to diagnose.
- I also encountered problems relating to permissions, especially on Android.
All in all, it was a fun journey and I’m happy with how the app ended up. If you are interested, you can check out the brand’s instagram page.