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
Refactored 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:
- Maintainability and separation of concerns
- Testability of each component
- Scalability for future features
📈 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:

- Streamlined navigation and data flow
- Consistent UI across activities
- Live updates via ViewModel + LiveData
⬇️ Downloads
Compare the original vs enhanced projects directly: