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.
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
- 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
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
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 | |
| DATASTORE_IN_COMPOSE.md | User preferences storage | |
| HILT_DEPENDENCY_INJECTION.md | Dependency injection patterns | |
| 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
- LoginScreen: User login interface for app access
- MainScreen: Central navigation hub for accessing all features
- MainActivity: Manages overall app navigation using Jetpack Compose Navigation
- PatientHomeScreen: Dashboard showing pill schedule overview
- PatientPillScreens: Pill browsing and selection interface
- EditPillScreen: Modify existing pill details
- PillLoggingScreen: Record when pills are taken
- RemindersScreen: View all scheduled reminders
- AddReminderScreen: Create new medication reminders
- EditReminderScreen: Modify existing reminders
- CalendarScreen: Visual calendar view of medication schedule
- ProfileScreen: User profile and account settings
- SettingsScreen: App preferences and configuration
- PatientScreen: Patient profile information
- ReminderBroadcastReceiver: Receives alarm broadcasts and displays notifications
- Notification System: Posts local notifications at scheduled times for reminders
data class Pill(
val id: Long,
val name: String,
val date: String,
val time: String
)data class Reminder(
val id: Long,
val pillName: String,
val time: String,
val isDone: Boolean = false
)The app requires the following Android permissions (declared in AndroidManifest.xml):
POST_NOTIFICATIONS: To display reminder notificationsSCHEDULE_EXACT_ALARM: To schedule exact alarm times for reminders
- Android Studio with Kotlin support
- JDK 11 or higher
- Android SDK 36 (or higher)
- Clone/Open the project in Android Studio
- Sync Gradle to download dependencies
- Build the app:
./gradlew build
- Run on emulator or device:
./gradlew installDebug
- 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 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)
The app uses Jetpack Compose Navigation for screen transitions:
- User starts at LoginScreen
- Upon authentication, navigates to MainScreen
- From MainScreen, users can access:
- Pill management screens (PatientHomeScreen, PillLoggingScreen)
- Reminder management (RemindersScreen, AddReminderScreen)
- Profile & settings (ProfileScreen, SettingsScreen)
- Create a new Composable function in a new
.ktfile - Add a navigation route in
MainActivity.kt - Update navigation graph with
composable()entry - Link from existing screens
- 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)
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
- The app uses local notifications for reminders (via AlarmManager)
- Reminder status tracking is implemented with
isDoneboolean flag - User authentication is handled before accessing main app features
- Data persistence strategy managed through Repository pattern (PillRepository, ReminderRepository)
- 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