DEV Community

Cover image for GSoC mid term report for Health
Aman Kumar
Aman Kumar

Posted on

GSoC mid term report for Health

It's been a while since I last updated my progress. I've made significant progress after the last update.
I started creating the User model in the last update. By now, I have migrated the whole User model to the Database from the GSettings and refactored the codebase accordingly.

Here is my major progress so far:

  • Creation of a new User model: The new user model comprises all the user details that were initially saved in the GSettings such as user_birthday, user_height, etc. This new model will help in associating each user with a single data structure.
pub struct User {
        pub user_id: i64,
        pub user_name: String,
        pub user_birthday: glib::DateTime,
        pub user_height: Length,
        pub user_weightgoal: Mass,
        pub user_stepgoal: i64,
        pub enabled_plugins: Vec<PluginName>,
        pub recent_activity_types: Vec<ActivityType>,
        pub did_initial_setup: bool,

Enter fullscreen mode Exit fullscreen mode
  • Migration to Database
    The current user data is being stored in the Database instead of GSettings for additional flexibility and to help in the support for multiple different users. Each user is assigned a user ID and the active user ID is saved in the GSettings for quick access to a particular user.

  • Associating Weights and Activities to a User
    The next part of my project dealt with associating weights and activities to a particular user, such that each data can be saved and extracted based on the user ID of a particular user.

  • Handling Database Migration
    Earlier the migration function to migrate Date to DateTime ran for every function and it resulted in a slower application start time. This has been fixed by adding a Version to the Database such that if the Database version is equal to the current version, we skip the migration otherwise, we run the migration and update the database. Furthermore, three additional migration functions are added such that an initial User will be created from the data in the GSettings file and associate each activity and weight to an initial user with user ID 1.

  • Adding a method to switch users
    The final part up to my mid-term evaluation dealt with adding a UI to switch multiple users.

That's all for my project until now. Here's a link to my MR:

Next Steps:
Now, I would be working on:

  • Adding a new sync model that would help in the support of multiple sync providers for different health categories for each user.
  • Pulling out actual activities from Google Fit,
  • Two way sync support
  • Adding a UI to handle switching of multiple sync providers.

See you all after 3 weeks. Thanks for reading!

Top comments (0)