Introduction
enviroCar is an Android app that uses a car’s onboard sensors to collect data such as speed, fuel consumption, altitude, CO2 emission etc. using an OBD-II device to which it connects via Bluetooth. The data is then used by citizen scientists and traffic planners for research and development.
Although enviroCar app has been in use since 2013, it’s only been available to Android users so far. Therefore, the aim of this project was to create a cross-platform enviroCar app that would run on both Android as well as iOS devices. The idea was to lay the groundwork on which the community could later build the rest of the app. Happily, with great teamwork, time management and support from mentors, we came quite far from laying just the groundwork.
Throughout the GSoC we had frequent team meetings to stay motivated and on track. There we discussed the major achievements of that week, the tasks for next week and any blockers that needed resolution.
Since I was working alongside Khyati on this project, we decided to split our work into two very broad categories. Khyati took the task of creating the Bluetooth features of the enviroCar app, while I took the task of creating and setting up the rest of the app.
To keep the development process streamlined and the path clear to myself, I divided the development process into 3 broad parts:
1. The UI
2. Core features
3. Data storage and sharing
The UI
I kicked off the GSoC’s first phase by focusing on building the UI components of the app while making sure all of them were responsive. The app was to be cross-platform while keeping in mind the needs and behavior of both Android and iOS users. Thus, we worked on creating widgets that did not strictly follow either Google’s Material Design or Apple’s Flat Design but touched upon both of them while maintaining a unique style of itself. More details can be found in my first and mid term posts (see links below).
First Blog Post
https://blog.52north.org/2021/07/02/envirocar-platform-independent-app-groundwork/
Mid Blog Post
https://blog.52north.org/2021/07/28/envirocar-platform-independent-app-groundwork-mid-term-post/
Core Features
Once the team was satisfied with the UI, I jumped straight into adding some core features to the whole project to improve its performance, readability and development process. These included, but were not limited to
- Adding Continuous Integration using GitHub Actions (GitHub Actions documentation)
- Adding Linting (further reading, i.e. the supported linting rules for Dart)
- Adding Logging using the logger package of Flutter
- Adding Exception Handling
Since the focus was more on laying a proper groundwork for the community to build the rest of the app upon, we had to make sure that this groundwork was absolutely solid. We focused a lot of time on making sure that all the exceptions and errors that could occur while making HTTP calls were caught and an appropriate message was shown to the user. The details can be found in the mid term blog post.
Data Management
During the final phase of GSoC, I started working on data management in the app. The app receives data, such as tracks, cars, logs etc. from the server, which need to be displayed to the user. As a result, I had to create some more UI components, e.g., graph widgets to display statistical data of tracks. An example of the graphs screen is shown below.
We used Hive DB to store the same data in the user’s local device. Initially we made some progress with SQflite, but later shifted to Hive. Hive DB can query data faster than SQflite and suits this project best. The data is fetched from the Hive DB when the user is disconnected from the internet and from the server if the user is connected to the internet. Also, the data in the local DB gets refreshed each time data is fetched from the server in order to remove any data difference between the two sources.
I also added a couple more features that are being implemented in the Android app as well, e.g., a walkthrough on the dashboard screen for new users and the dark theme.
In addition, I spent the last week adding documentation to the app and created a data flow diagram and data management diagram that can be found below as well as in the app’s GitHub repository.
Conclusion
It’s hard to believe that we’ve already completed our two months journey together. It was full of learning and trying out new things, tackling challenges and pushing our boundaries to achieve quality results within the set deadlines. At the end of this beautiful journey, I want to thank my lovely mentors Benjamin Pross, Sebastian Drost, Arvind Negi and Ann Hitchcock and my fellow GSoC students in 52°North, Khyati and Sai Karthikeya for always being there to help me out whenever I felt stuck. The journey of GSoC may have ended here but it’s just the beginning of my open source journey.
Ayush Singh says
I will work for this