Project Enhancements

Modernizing the CS360 Weight Tracker App

Overview

This page highlights the structural, functional, and UI enhancements made to the original Android weight tracking app for my CS499 Capstone. Improvements include modern architecture, maintainability, design patterns, performance, and user experience.

Before vs After: Project Structure

Below is a visual comparison of the original tightly coupled file structure and the enhanced MVVM-based, modular architecture.

Original Layout

Old Layout

Refactored Layout

New Layout

🏗️ Enhancement: Architecture & Design

The original app used findViewById with no separation of concerns. All logic was tightly coupled in MainActivity.java, making testing and scaling difficult.

In the enhanced version, I adopted the MVVM architecture. Data operations are now handled via ViewModels and Repositories. This improves:

📈 Enhancement: Weight Trend Calculation

This new logic calculates the percent change in weight between the user's first and latest entries, providing users with meaningful insights:


// Calculate and display percent change
private void updatePercentChange(List<WeightEntryEntity> weights) {
    if (weights.size() >= 2) {
        float firstWeight = weights.get(0).weight;  // oldest
        float lastWeight = weights.get(weights.size() - 1).weight; // newest

        if (firstWeight != 0) {
            float percentChange = ((lastWeight - firstWeight) / firstWeight) * 100;
            percentChangeText.setText(String.format("Change: %.2f%%", percentChange));
        } else {
            percentChangeText.setText("Change: N/A");
        }
    } else {
        percentChangeText.setText("Change: N/A");
    }
}
      

🎨 Enhancement: Improved UI Dashboard

I also redesigned the UI for clarity and functionality. Here is the updated main dashboard:

App Screenshot

⬇️ Downloads

Compare the original vs enhanced projects directly: