๐ง Save Our Water - Android Water Conservation Tracker
Turning every drop count into a global movement.
Save Our Water is an innovative Android application that empowers users to track, reduce, and contextualize their water footprint through gamification, real-time tracking, and impact visualization.
<<<<<<< Updated upstream
======= ## ๐ Table of Contents- ๐ Project Overview
- ๐ธ Screenshots
- ๐ Features
- ๐ ๏ธ Technology Stack
- ๐ Project Structure
- ๐ฏ Development Timeline
- ๐ฒ Installation
- ๐งช Testing
- ๐ API Documentation
- ๐ค Contributing
- ๐ Changelog
- ๐ License
Stashed changes
๐ Project Overview
๐ก The Problem
We live in a world where we track everythingโsteps, calories, screen timeโyet we completely ignore the most finite resource that keeps us alive: Water. Most people turn on the tap assuming the flow is endless, without accountability for consumption.
โจ The Solution
Save Our Water transforms passive water consumption into active environmental stewardship through:
- ๐ง Real-time water usage tracking
- ๐ฏ Gamified conservation goals
- ๐ Impact visualization & contextual insights
- ๐ Achievement system for behavioral change
- ๐ Educational content on water conservation
๐ธ Screenshots
๐ Home Dashboard
Real-time water usage overview with daily stats, weekly trend chart, and quick action buttons. Features streak counter, conservation tips, and recent activity feed.
๐ง Water Tracking Interface
Intuitive activity logging with 6 preset categories (Shower, Tap, Toilet, Laundry, Dishes, Garden). Smart estimation based on duration and flow rate.
๐ Activity History & Analytics
Comprehensive usage history with filterable timeline, detailed breakdown by category, and visual progress toward daily goals.
๐ Achievements Gallery
Gamification system with 12 unlockable achievements across Bronze, Silver, Gold, and Platinum tiers. Tracks streaks, conservation milestones, and behavioral goals.
๐ฅ Streak Progress & Milestones
Achievement detail view showing progress tracking, unlock requirements, and sharing functionality. Motivates consistent water-saving habits.
โจ Design Highlights:
- Material Design 3 with custom color palette
- Smooth animations and transitions
- Dark mode support (system-aware)
- Accessibility-first approach
๐ Features
๐ฑ Core Functionality
- ๐ฟ Activity-based tracking - Log showers, taps, toilet flushes, laundry, dishes, garden watering
- ๐งฎ Automatic calculations - Smart water usage estimates based on activity type and duration
- ๐ฏ Daily goals & progress - Set conservation targets and track real-time performance
- ๐ด Offline-first - Works without internet, syncs when connected via Supabase
- ๐ Real-time updates - LiveData & StateFlow ensure instant UI updates
๐ฎ Gamification
- ๐ Achievement system - Unlock badges for streaks, milestones, and efficient usage
- ๐ฅ Streak tracking - Build daily conservation habits with visual streak counters
- ๐ Progress visualization - Beautiful charts and graphs with MPAndroidChart
- ๐ Notifications - Celebrate achievements and receive daily reminders
- ๐ฅ Tier system - Bronze, Silver, Gold, and Platinum achievements
๐ Value Awareness
- ๐ฌ Contextual insights - "You saved enough water to sustain a family for a week!"
- ๐ Real-world comparisons - Translate liters into tangible equivalents
- ๐ Educational content - Water facts, conservation tips, best practices
- ๐งฎ Impact calculator - Project savings from behavioral changes
- ๐ Weekly trends - Visual breakdown of usage patterns
๐ ๏ธ Technology Stack
๐ฑ Android Development
- Language: Kotlin 1.9.21
- Min SDK: API 21 (Android 5.0 Lollipop) - 97%+ device coverage
- Target SDK: API 34 (Android 14)
- IDE: Android Studio (latest stable)
- Build Tool: Gradle 8.2.1 with Kotlin DSL
๐๏ธ Architecture
- Pattern: MVVM (Model-View-ViewModel)
- Architecture Components:
- ๐งฉ ViewModel - Lifecycle-aware UI state management
- ๐ก LiveData & StateFlow - Observable data holders with reactive updates
- ๐๏ธ Room Database - Local SQLite abstraction (v2.6.1)
- ๐งญ Navigation Component - Fragment navigation with SafeArgs (v2.7.6)
- โ๏ธ WorkManager - Background sync scheduling (v2.9.0)
- ๐ Repository Pattern - Single source of truth for data
๐ Libraries & Dependencies
- ๐จ UI: Material Design 3 (v1.11.0), MotionLayout, ViewBinding
- ๐ Charts: MPAndroidChart (v3.1.0)
- ๐ Networking: Retrofit 2.9.0 + OkHttp 4.12.0
- ๐๏ธ Database: Room 2.6.1 + Supabase (cloud sync)
- โก Async: Kotlin Coroutines 1.7.3 + Flow
- ๐ผ๏ธ Image Loading: Coil 2.5.0
- ๐พ Preferences: DataStore 1.0.0
- ๐งช Testing: JUnit 5, Espresso 3.5.1, MockK 1.13.8
โ๏ธ Backend & Cloud
- Database: Supabase (PostgreSQL-based)
- Authentication: Supabase Auth (email/password, social logins)
- API: RESTful with Row Level Security
- Real-time: Supabase Realtime subscriptions
- Hosting: Supabase free tier (500MB DB, 2GB bandwidth/month)
๐ Project Structure
SaveOurWater/
โโโ app/
โ โโโ src/
โ โ โโโ main/
โ โ โ โโโ java/com/saveourwater/
โ โ โ โ โโโ SaveOurWaterApplication.kt # App initialization
โ โ โ โ โโโ ui/ # ๐จ UI layer (Fragments, Activities)
โ โ โ โ โ โโโ main/ # MainActivity & Navigation
โ โ โ โ โ โโโ home/ # ๐ Dashboard Fragment
โ โ โ โ โ โ โโโ HomeFragment.kt
โ โ โ โ โ โ โโโ HomeViewModel.kt
โ โ โ โ โ โ โโโ RecentActivitiesAdapter.kt
โ โ โ โ โ โโโ tracking/ # ๐ Water Tracking
โ โ โ โ โ โ โโโ TrackingFragment.kt
โ โ โ โ โ โ โโโ TrackingViewModel.kt
โ โ โ โ โ โ โโโ ActivityAdapter.kt
โ โ โ โ โ โโโ achievements/ # ๐ Achievements (Phase 3)
โ โ โ โ โ โโโ insights/ # ๐ก Insights (Phase 4)
โ โ โ โ โ โโโ onboarding/ # ๐ Onboarding (Phase 5)
โ โ โ โ โโโ data/ # ๐๏ธ Data layer
โ โ โ โ โ โโโ local/ # Room Database
โ โ โ โ โ โ โโโ dao/ # Data Access Objects
โ โ โ โ โ โ โ โโโ WaterActivityDao.kt
โ โ โ โ โ โ โ โโโ EcoGoalDao.kt
โ โ โ โ โ โ โโโ entities/ # Database entities
โ โ โ โ โ โ โ โโโ WaterActivity.kt
โ โ โ โ โ โ โ โโโ EcoGoal.kt
โ โ โ โ โ โ โโโ database/ # Database setup
โ โ โ โ โ โ โโโ AppDatabase.kt
โ โ โ โ โ โ โโโ Converters.kt
โ โ โ โ โ โโโ remote/ # Supabase API
โ โ โ โ โ โ โโโ api/
โ โ โ โ โ โ โโโ SupabaseApi.kt
โ โ โ โ โ โโโ repository/ # Repository pattern
โ โ โ โ โ โโโ WaterRepository.kt
โ โ โ โ โโโ utils/ # โ๏ธ Utilities
โ โ โ โ โโโ WaterCalculator.kt
โ โ โ โโโ res/ # ๐จ Resources
โ โ โ โ โโโ layout/ # XML layouts (9 files)
โ โ โ โ โโโ drawable/ # Vector icons (13 files)
โ โ โ โ โโโ color/ # Color selectors
โ โ โ โ โโโ values/
โ โ โ โ โ โโโ colors.xml # Color palette (73 colors)
โ โ โ โ โ โโโ strings.xml # All UI text (123 strings)
โ โ โ โ โ โโโ themes.xml # Material Design 3 themes
โ โ โ โ โโโ navigation/ # Navigation graph
โ โ โ โ โโโ menu/ # Bottom navigation menu
โ โ โ โโโ AndroidManifest.xml
โ โ โโโ test/ # ๐งช Unit tests
โ โ โโโ androidTest/ # ๐ฑ Instrumentation tests
โ โโโ build.gradle.kts
โ โโโ proguard-rules.pro
โโโ gradle/
โโโ build.gradle.kts
โโโ settings.gradle.kts
โโโ gradle.properties
โโโ README.md
๐ Current Implementation Stats
- Total Files: 45 source files
- Kotlin Files: 19 classes
- XML Resources: 26 files
- Vector Drawables: 13 custom icons
- Lines of Code: ~3,500+ lines
- Architecture: 100% MVVM with Repository pattern
๐ฏ Development Timeline
Duration: January 23 - February 13, 2026 (3 weeks)
โ Phase 1: Foundation (Jan 23-25) - COMPLETED
- โ Project setup & Gradle configuration
- โ Database schema (Room entities: WaterActivity, EcoGoal)
- โ Supabase configuration
- โ Material Design 3 theming (73 colors, custom styles)
- โ Application class with notification channels
โ Phase 2: Core Tracking (Jan 26-30) - COMPLETED
- โ MainActivity with Bottom Navigation
- โ TrackingFragment with activity grid (6 activities)
- โ TrackingViewModel with LiveData/StateFlow
- โ WaterRepository (offline-first with sync)
- โ WaterCalculator utility (usage estimation)
- โ HomeFragment dashboard with stats cards
- โ HomeViewModel with insights generation
- โ RecentActivitiesAdapter with relative time
- โ Navigation graph with 4 destinations
- โ 13 custom vector icons (activities + navigation)
๐ง Phase 3: Gamification (Jan 31 - Feb 4) - IN PROGRESS
- โณ Achievement system implementation
- โณ Streak tracking logic
- โณ Notifications for achievements
- โณ AchievementsFragment UI
โณ Phase 4: Value Awareness (Feb 5-7) - PENDING
- โณ Insights generation engine
- โณ Educational content database
- โณ Impact calculator
- โณ InsightsFragment UI
โณ Phase 5: UI Polish (Feb 8-11) - PENDING
- โณ MotionLayout animations
- โณ Dark mode support
- โณ Onboarding flow
- โณ Edge-to-edge display
- โณ Lottie animations for achievements
โณ Phase 6: Testing & Deployment (Feb 12-13) - PENDING
- โณ Unit test suite (JUnit + MockK)
- โณ UI tests (Espresso)
- โณ APK generation with ProGuard
- โณ Play Store assets preparation
๐ง Setup Instructions
๐ Prerequisites
- โ Android Studio: Latest stable version (Hedgehog or newer)
- โ JDK: Version 17+
- ๐ฑ Android SDK: API 21+ (automatically installed by Studio)
- ๐ง Git: For version control
๐ Installation
- Clone the repository
git clone https://github.com/judeprod/AppDev-Final-Project.git
cd AppDev-Final-Project- Open in Android Studio
- File โ Open โ Select project directory
- Wait for Gradle sync to complete (may take 2-5 minutes)
- If prompted, accept Android SDK licenses
- Configure Supabase (Optional - for cloud sync)
- Create a Supabase account (free tier)
- Create a new project
- Copy your Project URL and Anon Key from Settings โ API
- Update
gradle.properties:
supabase.anon.key=YOUR_SUPABASE_ANON_KEY_HERE- Build and Run
- Select an emulator (API 21+) or connected physical device
- Click Run (
โถ๏ธ ) or pressShift + F10 - App should launch on your device/emulator
โ ๏ธ Troubleshooting
- Gradle sync fails: Ensure you have JDK 17+ and stable internet
- Build errors: Clean project with
Build โ Clean Project, then rebuild - Missing dependencies: Invalidate caches with
File โ Invalidate Caches โ Invalidate and Restart
๐งช Testing
Unit Tests
# Run all unit tests
./gradlew test
# Run tests with coverage
./gradlew testDebugUnitTest jacocoTestReportInstrumentation Tests
# Run UI tests (requires connected device/emulator)
./gradlew connectedAndroidTest
# Run specific test class
./gradlew connectedAndroidTest -Pandroid.testInstrumentationRunnerArguments.class=com.saveourwater.ExampleTestCode Quality
# Lint check
./gradlew lint
# Generate lint report
./gradlew lintDebug๐ฑ Building APK
Debug Build
./gradlew assembleDebug
# Output: app/build/outputs/apk/debug/app-debug.apkRelease Build (Signed)
./gradlew assembleRelease
# Output: app/build/outputs/apk/release/app-release.apk
# Note: Requires keystore configuration in gradle.propertiesInstall on Device
# Install debug APK
adb install app/build/outputs/apk/debug/app-debug.apk๐ Changelog
Version 1.3.0-beta (February 2, 2026)
๐ Phase 3: Gamification & Engagement
Added:
- โจ Achievement System - Complete gamification framework with 12 unlockable achievements
- โจ AchievementManager - Progress tracking and automatic unlock logic
- โจ Achievement Notifications - Real-time notifications when achievements are unlocked
- โจ Streak Calculation - Proper consecutive day tracking algorithm
- โจ Achievements UI - Gallery screen with category tabs, progress cards, and detail bottom sheet
- โจ Share Achievements - Social sharing functionality for unlocked achievements
- โจ Home Streak Widget - Live streak counter on home dashboard
Achievements Implemented:
| Tier | Achievement | Target |
|---|---|---|
| ๐ฅ Bronze | Getting Started | 3-day streak |
| ๐ฅ Silver | Week Warrior | 7-day streak |
| ๐ฅ Gold | Two Week Champion | 14-day streak |
| ๐ Platinum | Monthly Master | 30-day streak |
| ๐ฅ Bronze | Drop Saver | Save 100L |
| ๐ฅ Silver | Water Guardian | Save 500L |
| ๐ฅ Gold | Conservation Hero | Save 1000L |
| ๐ Platinum | Planet Protector | Save 5000L |
| ๐ฅ Bronze | First Drop | Log 1 activity |
| ๐ฅ Bronze | Eco Starter | 5 eco-mode uses |
| ๐ฅ Silver | Goal Crusher | 7 days under goal |
| ๐ฅ Silver | Well Rounded | Log all 6 types |
New Files:
Achievement.kt- Room entity with category/tier enumsAchievementDao.kt- Flow-based DAO queriesAchievementDefinitions.kt- 12 predefined achievementsAchievementManager.kt- Progress checking & unlock logicNotificationHelper.kt- Achievement unlock notificationsAchievementsFragment.kt- Achievements gallery screenAchievementsViewModel.kt- Category filtering & progressAchievementsAdapter.kt- Achievement cards with animationsAchievementDetailBottomSheet.kt- Detail view with sharing- 3 new layouts:
fragment_achievements.xml,item_achievement.xml,dialog_achievement_detail.xml - 7 achievement icons
Modified Files:
AppDatabase.kt- Added Achievement entity, DAO, seeding callback (v1โv2)Converters.kt- Added AchievementCategory/Tier convertersWaterRepository.kt- Added streak calculation methodsSaveOurWaterApplication.kt- Added lazy-init DI for AchievementManagerHomeViewModel.kt- Connected streak widget to live datacolors.xml- Addedsuccess_lightcolor
Technical Details:
- Database version upgrade: 1 โ 2 with destructive migration
- Achievement seeding via Room database callback on first install
- Streak algorithm tracks consecutive days (breaks on gaps)
- Build verified with
./gradlew assembleDebug(successful)
Version 1.2.0-beta (February 2, 2026)
๐จ UI Color Scheme Refinement
Updated:
- ๐จ Primary Color Palette - Replaced bright cyan-based colors with refined Twine.net blue palette
- Primary 500:
#00A8E8โ#628ECB(softer, more professional blue) - Primary 700:
#006494โ#395886(deeper navy for better contrast) - Primary 50-900: Complete gradient updated for visual consistency
- Primary 500:
- ๐จ Enhanced Visual Identity - New color scheme better represents water conservation theme
- ๐จ Improved Accessibility - Better color contrast ratios for text readability
Technical Details:
- Updated
colors.xmlwith 11 new primary color values - Maintained Material Design 3 color system structure
- Preserved all secondary (green), warning, error, and neutral colors
- Build verified with
./gradlew assembleDebug(successful)
Design Rationale:
- Previous bright cyan (#00A8E8) was too vibrant for extended use
- New palette (#628ECB) provides a calmer, more trustworthy appearance
- Aligns with water conservation messaging (calm, thoughtful, sustainable)
Version 1.1.0-beta (January 26, 2026)
๐ Enhanced Estimation Logic (Professor Feedback Implementation)
Added:
- โจ Behavioral Estimation Algorithm - Calculate water volume based on user habits instead of guessing
- Formula:
EstimatedVolume = (BaseFlowRate ร PressureMultiplier ร Duration) ร ContinuityFactor
- Formula:
- โจ FlowPressure enum - Low (0.8x), Normal (1.0x), High (1.5x) multipliers
- โจ WaterSource enum - Shower (9 L/min), Bucket/Faucet (6 L/min) base rates
- โจ DetailedTrackingBottomSheet - New UI for detailed water usage tracking
- โจ Enhanced WaterCalculator - Added
calculateEstimatedVolume()function - โจ 4 New Input Components:
- ๐ฟ Water Source Selector (Shower vs Bucket/Faucet)
- ๐ง Flow Pressure Gauge (Low/Normal/High)
- โป๏ธ Eco-Mode Toggle (Intermittent water use reduces consumption by 40%)
- โฑ๏ธ Duration Input (Minutes of water flow)
UI/UX:
- ๐จ dialog_detailed_tracking.xml - Material Design 3 bottom sheet layout
- ๐จ bg_eco_mode_card.xml - Custom background for eco-mode toggle
- ๐จ 12 new string resources for detailed tracking UI
- ๐จ Real-time volume calculation - Updates as user changes inputs
Technical Improvements:
- โก Integrated DetailedTrackingBottomSheet with TrackingFragment
- โก Added
logDetailedActivity()to TrackingViewModel - โก FAB now opens detailed tracking dialog instead of placeholder
- โก Activity logged with "Detailed tracking estimation" notes
Example Calculations:
- Shower + High Pressure + 5 min + Continuous = 67.5 L
- Bucket + Low Pressure + 10 min + Eco-Mode = 28.8 L
- Shower + Normal + 3 min + Eco-Mode = 16.2 L
Documentation:
- ๐ Updated
CODE_REVIEW_PHASE2_CORE_TRACKING_FEATURES.mdwith PHASE2-FEAT-P1-023 task - ๐ Added implementation details and acceptance criteria
Version 1.0.0-beta (January 24, 2026)
๐ Phase 2 Implementation - Core Tracking Features
Added:
- โจ MainActivity with Material Design 3 bottom navigation
- โจ TrackingFragment with 6 activity types (Shower, Tap, Toilet, Laundry, Dishes, Garden)
- โจ TrackingViewModel with reactive LiveData/StateFlow for real-time updates
- โจ HomeFragment dashboard with today's usage, streak counter, and goal progress
- โจ HomeViewModel with contextual insights generation
- โจ WaterRepository implementing offline-first pattern with Room + Supabase sync
- โจ WaterCalculator utility with smart usage estimation (10 L/min shower, 7 L/min tap, etc.)
- โจ RecentActivitiesAdapter with relative time display ("2 hours ago", "Just now")
- โจ 13 custom vector icons for activities and navigation
- โจ Navigation graph with SafeArgs for type-safe navigation
- โจ Weekly usage chart placeholder (MPAndroidChart integration)
Database:
- ๐๏ธ Created WaterActivity entity with 8 fields (id, activityType, litersUsed, durationSeconds, timestamp, notes, syncedToCloud, cloudId)
- ๐๏ธ Created EcoGoal entity for daily water limits
- ๐๏ธ Implemented WaterActivityDao with 10 queries including Flow-based reactive queries
- ๐๏ธ Implemented EcoGoalDao for goal management
- ๐๏ธ Created AppDatabase singleton with TypeConverters for ActivityType enum
UI/UX:
- ๐จ Comprehensive color palette with 73 colors (primary blue gradient, conservation green, achievement tiers)
- ๐จ Material Design 3 themes with custom card, button, and text styles
- ๐จ Bottom navigation selector with color states
- ๐จ Splash screen background with water blue gradient
- ๐จ 9 XML layouts including responsive grids and cards
Resources:
- ๐ 123 string resources for complete UI text
- ๐จ 13 vector drawables (ic_shower, ic_tap, ic_toilet, ic_laundry, ic_dishes, ic_garden, ic_custom, ic_home, ic_track, ic_achievements, ic_insights, ic_water_drop)
- ๐ง gradle.properties with AndroidX and build optimizations
Technical Improvements:
- โก Kotlin Coroutines for async operations
- โก StateFlow for reactive UI updates
- โก ViewBinding enabled for null-safe view access
- โก Repository pattern for clean architecture
- โก Offline-first data strategy
Fixed:
- ๐ Missing drawable resources causing build failures
- ๐ Bottom navigation icon references
- ๐ Gradle configuration for KSP and Navigation SafeArgs
Version 0.1.0-alpha (January 23-25, 2026)
๐ Phase 1 Implementation - Foundation & Architecture
Added:
- โจ Initial project setup with Kotlin 1.9.21 and AGP 8.2.1
- โจ MVVM architecture foundation with Android Architecture Components
- โจ Room Database configuration (v2.6.1)
- โจ Retrofit setup for Supabase API integration
- โจ Material Design 3 theming system
- โจ SaveOurWaterApplication class with notification channels
- โจ AndroidManifest with permissions (INTERNET, ACCESS_NETWORK_STATE, POST_NOTIFICATIONS, VIBRATE)
- โจ Comprehensive string resources (123 strings)
- โจ Color system with water blue and conservation green palettes
- โจ ProGuard rules for release builds
Dependencies Added:
- ๐ฆ AndroidX Core KTX 1.12.0
- ๐ฆ Material Components 1.11.0
- ๐ฆ Navigation Component 2.7.6
- ๐ฆ Room Database 2.6.1
- ๐ฆ Retrofit 2.9.0 + OkHttp 4.12.0
- ๐ฆ Kotlin Coroutines 1.7.3
- ๐ฆ MPAndroidChart 3.1.0
- ๐ฆ Coil 2.5.0
- ๐ฆ DataStore 1.0.0
- ๐ฆ WorkManager 2.9.0
Infrastructure:
- ๐ง Git repository initialized
- ๐ง GitHub remote configured (https://github.com/judeprod/AppDev-Final-Project)
- ๐ง Gradle build system with Kotlin DSL
- ๐ง Multi-module architecture prepared
Version 0.3.0-alpha (January 29, 2026)
๐ Phase 3 Implementation - Coming Soon
๐ค Contributing
We welcome contributions! Please follow these steps:
- ๐ด Fork the repository
- ๐ฟ Create a feature branch (
git checkout -b feature/AmazingFeature) - ๐พ Commit your changes (
git commit -m 'Add some AmazingFeature') - ๐ค Push to the branch (
git push origin feature/AmazingFeature) - ๐ Open a Pull Request
๐ Code Style Guidelines
- Follow Kotlin Coding Conventions
- Use meaningful variable and function names
- Add KDoc comments for public APIs
- Keep functions focused and under 20 lines when possible
- Write unit tests for new features
๐ License
This project is licensed under the MIT License - see the LICENSE file for details.
๐ Contact
๐ Project Team:
- ๐ Jay Arre Talosig - Machine Learning Engineer | Blockchain Developer
- ๐ง Jude Renwell B. Prodigalidad - Machine Learning Engineer | Mobile App Developer | Software Engineer
- ๐จ Diana Grace Paray - Digital Forensics Analyst | Software Engineer | UI/UX Designer
- ๐จโ๐ป Kris Brian Diaz - Digital Forensics Analyst | Software Engineer | UI/UX Designer
๐ Links:
- ๐ฆ Project Repository: https://github.com/judeprod/AppDev-Final-Project
- ๐ Documentation: Coming soon
- ๐ Issue Tracker: GitHub Issues
๐ Acknowledgments
- ๐ Inspiration: The global water crisis and the need for individual accountability
- ๐จ Design: Material Design 3 guidelines by Google
- ๐ Libraries: Android Jetpack, Supabase, MPAndroidChart community
- ๐ฏ Icons: Material Icons and custom vector designs
- ๐ก Architecture: Android App Architecture Guide
๐ Project Statistics
๐ง Making water visible, valuable, and sustainable - one drop at a time. ๐
Built with โค๏ธ for a better planet
ย ย ย ย





