Skip to content

nyinyiz/SamsungHealthDiary

Repository files navigation

Samsung Health Diary - Enhanced Edition

Modern Health Tracking App - A beautifully redesigned Samsung Health integration app featuring stunning Liquid Glass UI aesthetics and comprehensive health metrics visualization.

Original Project: Samsung Health Diary Sample

Android Kotlin Jetpack Compose Samsung Health


πŸ“± Screenshots

Home Screen

Home Screen

Steps Weekly

Steps Weekly

Heart Rate

Heart Rate

Sleep Tracking

Sleep Tracking

Water Intake

Water Intake

Workout Calendar

Workout Calendar

Settings

Settings


✨ Features

Feature Description Views Status
πŸ‘Ÿ Steps Daily/weekly/monthly tracking with visual charts Day/Week/Month + Swipe Navigation βœ… Complete
❀️ Heart Rate Real-time monitoring with detailed breakdowns Daily View βœ… Complete
😴 Sleep Session tracking with quality metrics (Oβ‚‚, temp) Daily Sessions βœ… Complete
πŸ’§ Water Intake Hydration tracking with animated water visualization Daily with Wave Animation βœ… Complete
πŸ‹οΈ Workout History Exercise tracking with charts and calendar Day/Week/Month + Charts βœ… Complete
🍎 Nutrition Meal logging and calorie tracking CRUD Operations βœ… Complete
πŸŒ“ Dark/Light Mode Dynamic theme with DataStore persistence App-wide βœ… Complete

🎨 Design System

Liquid Glass + Neo-Neon Aesthetic

Color Palette

  • Background: Deep Black (#0A0E27) β†’ Cosmic Navy (#1A1F3A) gradient
  • Glass Cards: Semi-transparent with blur effects and subtle glows
  • Accents:
    • πŸ”΅ Electric Blue (#00D4FF) - Steps
    • πŸ’— Hot Pink (#FF006B) - Heart Rate
    • πŸ’œ Neon Purple (#9B4DFF) - Sleep
    • πŸ’™ Cyan (#4FC3F7) - Water
    • ❀️ Red/Orange (#FF6B6B) - Workouts

UI Components

  • Glass Cards: Frosted glass effect with radial glows
  • Emoji Icons: Large, colorful emoji representations
  • Charts: Bar charts (weekly) and calendar grids (monthly)
  • Animations: Water wave effect, smooth transitions

πŸ‹οΈ Feature Highlights

Water Intake πŸ’§

  • Animated Visualization: Realistic water wave effect using Canvas
  • Sinusoidal Animation: Continuous wave motion at top of liquid
  • Daily Goal Tracking: Visual fill level based on intake vs. goal
  • Glass Container: Beautiful container with gradient water colors

Workout History πŸ‹οΈ

  • 40+ Exercise Types: Running, Cycling, Swimming, Yoga, and more
  • Weekly Bar Chart: Visual representation of workout frequency
  • Monthly Calendar: Color-coded workout intensity indicators
    • Light Orange: 1 workout
    • Orange: 2 workouts
    • Red: 3+ workouts
  • Swipe Navigation: Easily navigate between days/weeks/months
  • Emoji Icons: πŸƒ 🚴 🏊 🧘 for each exercise type

Modern Home Screen

  • 2-Column Grid Layout: Optimized space utilization
  • Large Emoji Cards: 48sp emojis for each health category
  • Interactive Cards: Radial glow effects matching category colors
  • Quick Access: One-tap navigation to any health metric

πŸ—οΈ Architecture

flowchart TD
    UI[🎨 UI Layer<br/>Jetpack Compose] --> VM[βš™οΈ ViewModel<br/>Hilt + StateFlow]
    VM --> REPO[πŸ’Ύ Repository<br/>Data Layer]
    REPO --> SDK[πŸ“± Samsung Health SDK]
    
    style UI fill:#00D4FF,stroke:#fff,color:#000
    style VM fill:#7F52FF,stroke:#fff,color:#fff
    style REPO fill:#1A1F3A,stroke:#00D4FF,color:#fff
    style SDK fill:#1428A0,stroke:#fff,color:#fff
Loading

Clean Architecture Pattern: UI β†’ ViewModel β†’ Repository β†’ Samsung Health SDK


πŸš€ Tech Stack

Category Technology Version
Language Kotlin 2.0.21
UI Jetpack Compose BOM 2024.12.01
DI Hilt 2.54
Navigation Compose Navigation 2.8.5
Async Coroutines + StateFlow 1.7.3
Storage DataStore Preferences 1.1.1
Health SDK Samsung Health Data API 1.0.0
Build Gradle 8.9 + AGP 8.8.0 -

πŸ“¦ Project Structure

healthdiary/
β”œβ”€β”€ 🎨 ui/
β”‚   β”œβ”€β”€ screens/          # 7 feature screens
β”‚   β”‚   β”œβ”€β”€ HealthMainScreen.kt    # 2-column grid with emoji cards
β”‚   β”‚   β”œβ”€β”€ StepScreen.kt          # Day/Week/Month views
β”‚   β”‚   β”œβ”€β”€ HeartRateScreen.kt     # Heart rate monitoring
β”‚   β”‚   β”œβ”€β”€ SleepScreen.kt         # Sleep sessions
β”‚   β”‚   β”œβ”€β”€ WaterIntakeScreen.kt   # Animated water visualization
β”‚   β”‚   β”œβ”€β”€ ExerciseScreen.kt      # Workout charts & calendar
β”‚   β”‚   └── NutritionScreen.kt     # Meal tracking
β”‚   β”œβ”€β”€ components/       # Reusable UI
β”‚   β”‚   β”œβ”€β”€ GlassCard.kt          # Glass effect cards
β”‚   β”‚   β”œβ”€β”€ ViewModeToggle.kt     # Day/Week/Month toggle
β”‚   β”‚   β”œβ”€β”€ WeeklyStepChart.kt    # Bar chart component
β”‚   β”‚   └── MonthlyCalendar.kt    # Calendar grid
β”‚   └── theme/           # Material 3 + Custom colors
β”œβ”€β”€ πŸ’Ύ data/
β”‚   └── repository/      # Samsung Health data access
β”œβ”€β”€ βš™οΈ viewmodel/         # Hilt ViewModels (7 total)
└── πŸ”§ di/               # Dependency injection modules

⚑ Quick Start

Prerequisites

  • Android Studio: Hedgehog (2023.1.1) or newer
  • JDK: 17 or higher
  • Device: Android 10+ with Samsung Health installed
  • Samsung Health: Version 6.30.2 or later

Build & Run

# Clone the repository
git clone [repository-url]
cd health-diary

# Build debug APK
./gradlew assembleDebug

# Or install directly to connected device
./gradlew installDebug

First Launch

  1. Launch App β†’ Tap any health category card
  2. Grant Permissions β†’ Samsung Health will prompt for READ permissions
  3. Enable Developer Mode in Samsung Health (tap version 10 times in About)
  4. Start Tracking! πŸŽ‰

πŸ” Permissions

All permissions are READ-ONLY for privacy and safety:

Permission Purpose Data Types
READ_STEPS View daily/weekly/monthly step counts STEPS
READ_HEART_RATE Monitor heart rate measurements HEART_RATE
READ_SLEEP Track sleep sessions with metrics SLEEP, BLOOD_OXYGEN, SKIN_TEMPERATURE
READ_WATER_INTAKE View daily hydration levels WATER_INTAKE
READ_EXERCISE Access workout/exercise history EXERCISE
READ/WRITE_NUTRITION View and log meals NUTRITION

ℹ️ Note: This app only reads data from Samsung Health. Water Intake and Workout History are display-only (no write access).


πŸ“± Screens Overview

Home Screen

  • 2x3 Grid Layout with large emoji cards
  • Categories: Steps πŸ‘Ÿ, Heart Rate ❀️, Sleep 😴, Water πŸ’§, Workouts πŸ‹οΈ
  • Glass Effect with radial glows per category
  • One-Tap Access to each health metric

Steps Screen

  • Day View: Hourly breakdown with step counts
  • Week View: 7-day bar chart (Sun-Sat)
  • Month View: Full calendar with color-coded activity levels
  • Swipe Navigation: Horizontal pager between time periods

Water Intake Screen

  • Animated Glass: Realistic water wave using Canvas
  • Dynamic Fill: Visual representation of intake vs. goal
  • Smooth Animation: Continuous sinusoidal wave motion
  • Daily Tracking: Total intake display

Workout History Screen

  • Day View: List of workouts with time, duration
  • Week View: Bar chart showing workout counts per day
  • Month View: Calendar grid with workout intensity colors
  • Exercise Types: 40+ types with unique emojis (πŸƒ 🚴 🏊 🧘 πŸ₯Š)

🎯 Key Improvements Over Original

Aspect Original This Version
UI Framework XML Views 100% Jetpack Compose
Design Material 2 Liquid Glass + Neo-Neon
Architecture Direct SDK calls Clean Architecture (MVVM)
DI Manual Factory Hilt
State LiveData StateFlow
Theme Static Persistent Dark/Light with DataStore
Navigation Fragment-based Compose Navigation
Charts Basic lists Visual charts & calendars
Animations None Water waves, smooth transitions
Home Screen List layout 2-column grid with emojis

🚧 Future Enhancements

  • Add write capabilities for Water Intake and Exercise
  • Implement data export (CSV/JSON)
  • Add widget support for quick stats
  • Implement data sync across devices
  • Add customizable goals and reminders
  • Include more detailed analytics and insights

πŸ› Known Issues

  • Exercise type extraction needs Samsung Health data investigation (currently shows generic "Exercise")
  • Custom exercise types may not display specific names

πŸ“„ License

Copyright Β© 2024 Samsung Electronics Co., Ltd.


πŸ™ Attribution


Built with ❀️ using Jetpack Compose

Track your health, visualize your wellness journey 🌟

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages