A production-ready native Android application for managing medicine schedules, tracking dose adherence, and receiving smart reminders — with an optional Firebase cloud sync.
| Feature | Description |
|---|---|
| 💊 Medicine Management | Add, edit, and delete medicines with dosage, frequency, colour labels, and stock tracking |
| ⏰ Smart Reminders | Exact alarm scheduling with actionable notifications (Taken / Missed inline buttons) |
| 📋 Dose History | Browse all dose logs with date-range and status filters |
| 📊 Adherence Reports | Monthly adherence %, daily bar charts, and per-medicine breakdown |
| 📦 Stock Tracking | Auto-decrement stock on intake; refill alerts when below threshold |
| 🔕 Missed Dose Detection | Auto-marks a dose as missed 60 minutes after its scheduled time |
| 🔄 Boot Persistence | Reschedules all alarms after device reboot, OTA update, or timezone change |
| 🌙 Theme & Font | Light / Dark / System theme, three font-size presets |
| ☁️ Cloud Sync (optional) | Firebase Auth + Firestore real-time sync with offline-first local Room DB |
| 📤 Data Export | Share adherence reports as plain text via Android Share Sheet |
MediTrack features a premium, modern UI built with Jetpack Compose Material 3:
- Glassmorphism — Semi-transparent cards with soft borders and blur-style layering
- Custom Floating Nav Bar — Pill-shaped bottom navigation with animated tab indicators
- Smooth Transitions — Slide + fade animations between all screens
- Dynamic Theming — System-aware dark/light mode with a curated colour palette
- Premium Typography — Rounded, modern type scale for readability
| Layer | Technology |
|---|---|
| Language | Kotlin |
| UI Framework | Jetpack Compose (Material 3) |
| Architecture | MVVM + Clean Architecture |
| Database | Room (SQLite) |
| Dependency Injection | Hilt |
| Navigation | Jetpack Navigation Compose + Animated transitions |
| Async | Kotlin Coroutines + StateFlow |
| Alarms | AlarmManager (Exact) |
| Charts | Vico (Compose M3) |
| Cloud (optional) | Firebase Auth + Firestore |
| Min SDK | 26 (Android 8.0 Oreo) |
| Target SDK | 34 (Android 14) |
┌──────────────────────────────────────────────────┐
│ Presentation │
│ Screens (Compose) │ ViewModels │ Components │
│ LoginScreen │ HomeVM │ MedicineCard│
│ RegisterScreen │ HistoryVM │ BottomNavBar│
│ HomeScreen │ ReportVM │ DoseLogItem │
│ AddMedicineScreen │ SettingsVM │ │
│ HistoryScreen │ AuthVM │ │
│ ReportScreen │ │ │
│ SettingsScreen │ │ │
├──────────────────────────────────────────────────┤
│ Domain │
│ Use Cases │ Models │
│ AddMedicineUseCase │ Medicine │
│ LogDoseUseCase │ DoseLog │
│ GetAdherenceReport │ DoseStatus, Frequency │
├──────────────────────────────────────────────────┤
│ Data │
│ Repositories │ Room DAOs │ Entities │
│ MedicineRepository │ MedicineDao│ Medicine │
│ DoseLogRepository │ DoseLogDao │ DoseLog │
│ FirestoreSyncService │ │ │
├──────────────────────────────────────────────────┤
│ System Services │
│ AlarmScheduler │ AlarmReceiver │ BootReceiver│
│ NotificationHelper │ MissedDoseReceiver │
└──────────────────────────────────────────────────┘
- Android Studio Hedgehog (2023.1.1) or later
- Android device or emulator running API 26+
- JDK 17
git clone https://github.com/YOUR_USERNAME/MediTrack.git
cd MediTrack- Select File → Open and navigate to the
MediTrackfolder - Let Gradle sync automatically
./gradlew installDebugOr press
Firebase is entirely optional. The app works fully offline without any Firebase configuration.
To enable cloud sync and authentication:
- Go to Firebase Console and create a project
- Add an Android app with package name:
com.meditrack.app - Download
google-services.jsonand place it at:app/google-services.json - Enable Email/Password Auth in Firebase Console → Authentication
- Enable Firestore and set the following security rules:
rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
match /users/{userId}/{document=**} {
allow read, write: if request.auth != null && request.auth.uid == userId;
}
}
}- Run Gradle sync and rebuild
If
google-services.jsonis absent, the app runs in local-only mode automatically.
For reliable reminders, disable battery optimization for MediTrack:
- Settings → Apps → MediTrack → Battery → Unrestricted
- Samsung users: Settings → Battery → App Power Management → Never sleeping apps → Add MediTrack
The app will prompt for this on first launch.
| Permission | Purpose |
|---|---|
RECEIVE_BOOT_COMPLETED |
Reschedule reminders after device reboot |
SCHEDULE_EXACT_ALARM / USE_EXACT_ALARM |
Accurate medicine-time alarms |
POST_NOTIFICATIONS |
Reminder and refill notifications (Android 13+) |
REQUEST_IGNORE_BATTERY_OPTIMIZATIONS |
Reliable background alarms on OEM devices |
VIBRATE |
Haptic notification alerts |
WAKE_LOCK |
Ensure alarm work completes |
INTERNET |
Optional Firebase sync/auth |
FOREGROUND_SERVICE |
Background reliability |
MediTrack/
├── app/
│ ├── src/main/java/com/meditrack/app/
│ │ ├── alarm/ # AlarmScheduler, AlarmReceiver, BootReceiver
│ │ ├── data/
│ │ │ ├── local/ # Room database, DAOs, Entities
│ │ │ ├── preferences/ # DataStore preferences
│ │ │ ├── repository/ # Repository implementations
│ │ │ └── sync/ # FirestoreSyncService
│ │ ├── di/ # Hilt modules
│ │ ├── domain/
│ │ │ ├── model/ # Medicine, DoseLog, enums
│ │ │ └── usecase/ # Business logic use cases
│ │ ├── notification/ # NotificationHelper, ActionReceiver
│ │ └── presentation/
│ │ ├── components/ # MedicineCard, BottomNavBar, DoseLogItem
│ │ ├── navigation/ # NavGraph, Screen definitions
│ │ ├── screens/
│ │ │ ├── auth/ # LoginScreen, RegisterScreen, AuthViewModel
│ │ │ ├── home/ # HomeScreen, HomeViewModel
│ │ │ ├── addmedicine/ # AddMedicineScreen, AddMedicineViewModel
│ │ │ ├── history/ # HistoryScreen, HistoryViewModel
│ │ │ ├── report/ # ReportScreen, ReportViewModel
│ │ │ └── settings/ # SettingsScreen, SettingsViewModel
│ │ └── theme/ # Color, Type, Theme
│ └── src/main/
│ ├── AndroidManifest.xml
│ └── res/ # Strings, drawables, icons
├── build.gradle.kts
├── settings.gradle.kts
└── README.md
- OEM background restrictions (especially on Xiaomi, Huawei, Samsung OneUI) may delay alarms even with optimizations disabled.
- Firebase Firestore cloud sync depends on security rules being correctly configured.
- Orphaned dose logs (for deleted medicines) in Firestore are skipped on pull — they don't cause crashes.
MIT License
Copyright (c) 2025 MediTrack
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.