Skip to content

DomJab23/msd

Repository files navigation

MSD - Medication & Reminder Management App

A comprehensive Android application built with Jetpack Compose for managing pills and medication reminders. This app helps users track their medication schedules and receive timely notifications about their pill intake.

Project Overview

MSD is a Kotlin-based Android application designed to:

  • Manage medication schedules with detailed pill information
  • Set and track medication reminders
  • Log pill intake with timestamps
  • Provide user authentication and personalized profiles
  • Schedule local notifications for reminder alerts

Tech Stack

  • Language: Kotlin
  • UI Framework: Jetpack Compose
  • Build System: Gradle (Kotlin DSL)
  • Min SDK: Android 24 (API Level 24)
  • Target SDK: Android 36 (API Level 36)
  • JVM Target: Java 11

Project Structure

msd/
├── build.gradle.kts              # Root project build configuration
├── settings.gradle.kts           # Gradle settings
├── gradle.properties             # Gradle properties
├── gradlew / gradlew.bat         # Gradle wrapper scripts
│
├── gradle/
│   ├── libs.versions.toml        # Centralized dependency management
│   └── wrapper/                  # Gradle wrapper configuration
│
└── app/                          # Main application module
    ├── build.gradle.kts          # App module build configuration
    ├── proguard-rules.pro        # ProGuard/R8 configuration
    │
    └── src/
        ├── main/
        │   ├── AndroidManifest.xml          # App manifest with permissions & components
        │   │
        │   ├── java/com/example/msd/
        │   │   # Core Data Models
        │   │   ├── Pill.kt                  # Pill data class (id, name, date, time)
        │   │   ├── Reminder.kt              # Reminder data class (id, pillName, time, isDone status)
        │   │   │
        │   │   # Data Access Layer
        │   │   ├── PillRepository.kt        # Manages pill data operations
        │   │   ├── ReminderRepository.kt    # Manages reminder data operations
        │   │   │
        │   │   # UI Screens (Jetpack Compose)
        │   │   ├── MainActivity.kt          # Entry point & navigation setup
        │   │   ├── LoginScreen.kt           # User authentication screen
        │   │   ├── MainScreen.kt            # Main navigation hub
        │   │   ├── PatientHomeScreen.kt     # Patient home/dashboard
        │   │   ├── PatientScreen.kt         # Patient profile/overview
        │   │   ├── PatientPillScreens.kt    # Pill management screens (likely multiple pill-related views)
        │   │   ├── CalendarScreen.kt        # Calendar view for medication schedule
        │   │   ├── PillLoggingScreen.kt     # Log pill intake
        │   │   ├── ProfileScreen.kt         # User profile settings
        │   │   ├── SettingsScreen.kt        # App settings
        │   │   ├── RemindersScreen.kt       # View all reminders
        │   │   ├── AddReminderScreen.kt     # Add new reminder
        │   │   ├── EditReminderScreen.kt    # Edit existing reminder
        │   │   ├── EditPillScreen.kt        # Edit pill details
        │   │   │
        │   │   # Background Services
        │   │   ├── ReminderBroadcastReceiver.kt  # Handles scheduled notification broadcasts
        │   │   │
        │   │   └── ui/theme/
        │   │       ├── Color.kt             # Color palette definitions
        │   │       ├── Theme.kt             # Compose theme configuration
        │   │       └── Type.kt              # Typography definitions
        │   │
        │   └── res/
        │       ├── drawable/                # Vector drawables & icons
        │       │   ├── ic_launcher_background.xml
        │       │   └── ic_launcher_foreground.xml
        │       ├── mipmap-*/                # App icons for different screen densities
        │       ├── values/
        │       │   ├── colors.xml           # Color resources
        │       │   ├── strings.xml          # String resources
        │       │   └── themes.xml           # Theme resources
        │       └── xml/
        │           ├── backup_rules.xml     # Cloud backup configuration
        │           └── data_extraction_rules.xml  # Data security rules
        │
        ├── androidTest/
        │   └── java/com/example/msd/
        │       └── ExampleInstrumentedTest.kt    # Android integration tests
        │
        └── test/
            └── java/com/example/msd/
                └── ExampleUnitTest.kt      # Unit tests

Documentation Files

The docs/ folder contains comprehensive guides for the technologies and patterns used in MSD:

📚 Start here: DOCUMENTATION_GUIDE.md - Complete guide to navigating all documentation

Document Purpose Status
DOCUMENTATION_GUIDE.md How to use all docs, find code samples ✅ Navigation Hub
COMPOSE_NAVIGATION.md Complete navigation setup using Jetpack Compose ✅ In Use
MATERIAL_DESIGN_3.md UI design system and theming ✅ In Use
MVVM_ARCHITECTURE.md Architecture pattern explanation ✅ In Use
SERVICES_IN_MSD.md Background services and reminders ✅ In Use
FLOW_AND_STATEFLOW_GUIDE.md Reactive data patterns 📚 Reference Only
COROUTINES.md Async/coroutine patterns 📚 Reference Only
ROOM_DATABASE_IMPLEMENTATION.md Database patterns ⚠️ Partial (not in use)
DATASTORE_IN_COMPOSE.md User preferences storage ⚠️ Reference Only
HILT_DEPENDENCY_INJECTION.md Dependency injection patterns ⚠️ Reference Only
CODE_LOCATIONS_REFERENCE.md Master index of code samples 🔍 Navigation Helper

Legend: ✅ In Use = Actively used in project | 📚 Reference Only = Educational/future implementation | 🔍 = Helper document


Key Features & Navigation

Authentication

  • LoginScreen: User login interface for app access

Dashboard & Navigation

  • MainScreen: Central navigation hub for accessing all features
  • MainActivity: Manages overall app navigation using Jetpack Compose Navigation

Pill Management

  • PatientHomeScreen: Dashboard showing pill schedule overview
  • PatientPillScreens: Pill browsing and selection interface
  • EditPillScreen: Modify existing pill details
  • PillLoggingScreen: Record when pills are taken

Reminder Management

  • RemindersScreen: View all scheduled reminders
  • AddReminderScreen: Create new medication reminders
  • EditReminderScreen: Modify existing reminders
  • CalendarScreen: Visual calendar view of medication schedule

User Settings

  • ProfileScreen: User profile and account settings
  • SettingsScreen: App preferences and configuration
  • PatientScreen: Patient profile information

Background Services

  • ReminderBroadcastReceiver: Receives alarm broadcasts and displays notifications
  • Notification System: Posts local notifications at scheduled times for reminders

Core Data Models

Pill

data class Pill(
    val id: Long,
    val name: String,
    val date: String,
    val time: String
)

Reminder

data class Reminder(
    val id: Long,
    val pillName: String,
    val time: String,
    val isDone: Boolean = false
)

Required Permissions

The app requires the following Android permissions (declared in AndroidManifest.xml):

  • POST_NOTIFICATIONS: To display reminder notifications
  • SCHEDULE_EXACT_ALARM: To schedule exact alarm times for reminders

Build & Setup

Prerequisites

  • Android Studio with Kotlin support
  • JDK 11 or higher
  • Android SDK 36 (or higher)

Build Instructions

  1. Clone/Open the project in Android Studio
  2. Sync Gradle to download dependencies
  3. Build the app:
    ./gradlew build
  4. Run on emulator or device:
    ./gradlew installDebug

Gradle Build System

  • Uses Kotlin DSL for build configuration
  • Centralized dependency management via gradle/libs.versions.toml
  • Jetpack Compose enabled for modern UI development
  • KSP (Kotlin Symbol Processing) configured for annotation processing

Dependencies Management

Dependencies are managed through gradle/libs.versions.toml for centralized version control:

  • AndroidX Core, Lifecycle, and Activity libraries
  • Jetpack Compose framework and UI components
  • Testing libraries (JUnit, Espresso, Compose testing)

Development Workflow

Navigation Flow

The app uses Jetpack Compose Navigation for screen transitions:

  1. User starts at LoginScreen
  2. Upon authentication, navigates to MainScreen
  3. From MainScreen, users can access:
    • Pill management screens (PatientHomeScreen, PillLoggingScreen)
    • Reminder management (RemindersScreen, AddReminderScreen)
    • Profile & settings (ProfileScreen, SettingsScreen)

Adding a New Screen

  1. Create a new Composable function in a new .kt file
  2. Add a navigation route in MainActivity.kt
  3. Update navigation graph with composable() entry
  4. Link from existing screens

Testing

  • Unit tests located in app/src/test/
  • Instrumented tests (Android-specific) in app/src/androidTest/
  • Run tests with: ./gradlew test (unit) or ./gradlew connectedAndroidTest (instrumented)

UI Theme & Styling

The app follows Material Design principles with custom theming:

  • Color.kt: Defines app color palette
  • Theme.kt: Applies Material theme and typography
  • Type.kt: Defines text styles for consistent typography

Notes

  • The app uses local notifications for reminders (via AlarmManager)
  • Reminder status tracking is implemented with isDone boolean flag
  • User authentication is handled before accessing main app features
  • Data persistence strategy managed through Repository pattern (PillRepository, ReminderRepository)

Future Enhancement Opportunities

  • Cloud synchronization of pills and reminders
  • Advanced scheduling options (recurring reminders)
  • Data analytics and medication compliance tracking
  • Integration with healthcare providers
  • Multi-user/caregiver support

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages