A Kotlin Android app to explore nearby healthcare options, consult doctors, browse medicines, scan medicines, chat with an AI health assistant, view map markers, capture media, and receive health provider notifications. Built with AndroidX, ViewBinding, Firebase Auth + Firestore, and Google Maps.
| Login | Registration | Dashboard | UI Interface |
|---|---|---|---|
| App Start Symbol | Doctor Contact | Doctor Mail | Consult Doctor |
|---|---|---|---|
| Maps Location | AI Chatbot | AI Alerts & Notification | Order Medicines |
|---|---|---|---|
| ML BERT Model (Reviews) | Multimedia Uploads | Medicine Scanner | Emergency Contact |
|---|---|---|---|
| Firebase Users | Firebase Project Details | Firebase Cloud Messaging | Firebase Authentication |
|---|---|---|---|
- Features
- Architecture & Tech Stack
- App Structure
- Screens & Workflows
- Data & Services
- Permissions
- Setup & Configuration
- Build & Run
- Troubleshooting
- Assets & Demo
- Main hub screen linking to all features.
- Email/Password authentication backed by Firebase Auth.
- Registration with unique username reservation stored in Firestore.
- Doctor directory with 1000 synthetic entries and quick actions (Call, Email).
- Medicine catalog with 5000 synthetic items, images, and fast client-side search.
- AI Health Chatbot using an on-device knowledge base for health Q&A.
- ML Insights screen showing generated doctor reviews with RecyclerView.
- Medicine Scanner demo that simulates a scan and shows medicine details from a local DB.
- Media utilities: capture photo, record video, and record audio with runtime permissions.
- Maps screen with Google Maps showing hospitals, clinics, and medical stores around Mumbai.
- Local notifications listing nearby providers, with Tiramisu notification permission handling.
- Language: Kotlin
- Min SDK 24, Target SDK 34, Java/Kotlin target 17
- Single app module
:app - ViewBinding enabled (no XML findViewById)
- Firebase: Auth, Firestore (via BoM)
- Google Play Services Maps
Gradle (excerpt):
- Plugins: com.android.application 8.5.2, org.jetbrains.kotlin.android 1.9.24, com.google.gms.google-services 4.4.2
- Dependencies: Firebase BoM 33.5.1, firebase-auth-ktx, firebase-firestore-ktx, AndroidX core/appcompat/material/activity/fragment/lifecycle, constraintlayout, play-services-maps
Namespace and IDs:
- Namespace:
com.example.medicineapp - Application ID:
com.example.medicinetrackingapp- Note: namespace and applicationId differ intentionally/accidentally; verify before publishing.
- Package:
com.example.medicineapp.ui - Activities/Fragments:
SplashActivity: Animated splash, routes to Login.LoginActivity: Firebase sign-in; opens Register and Forgot dialogs.RegistrationDialogFragment: Creates Auth user and writes username + user docs transactionally to Firestore.ForgotPasswordDialogFragment: Demo retrieval for a specific test user.MainActivity: Hub with buttons to Doctors, Medicines, ChatBot, Maps, ML Insights, Media, SOS dial, and notification channel/flow.DoctorListActivity: RecyclerView of synthetic doctors with Call/Email intents.MedicineListActivity: RecyclerView of synthetic medicines with search.MLInsightsActivity: RecyclerView of generated reviews; FAB to open Medicine Scanner.MedicineScannerActivity: Simulated scan flow, shows medicine details from a local list.MediaActivity: Camera/Video/Audio intents with runtime permission requests.MapsActivity: Google Map with markers for hospitals, clinics, and medical stores.ChatBotActivity: Simple on-device Q&A usingHealthKnowledgeBase.NotificationHelper: Notification channel + batched provider notifications.HealthKnowledgeBase: 100+ Q&A entries with keyword matching.
Key layouts (res/layout):
- activity_main.xml, activity_login.xml, activity_splash.xml
- activity_doctor_list.xml, item_doctor.xml
- activity_medicine_list.xml, item_medicine.xml
- activity_ml_insights.xml, item_review.xml
- activity_medicine_scanner.xml
- activity_media.xml
- activity_maps.xml
- activity_chat_bot.xml
- dialog_registration.xml, dialog_forgot_password.xml
- On launch: Splash → Login
- Login: Email/Password (email synthesized from username as
username@app.local) - Register: Validates unique username with Firestore transaction, creates user doc
- Main: Buttons navigate to feature screens; shows provider notifications (with POST_NOTIFICATIONS on Android 13+)
- Doctors: List with Call/Email quick actions
- Medicines: Large list + search filter
- ML Insights: Generated reviews; FAB opens Scanner
- Scanner: Simulated scan; shows details from local list
- Media: Photo/Video/Audio intents gated by runtime permissions
- Maps: Google Maps markers around Mumbai
- ChatBot: Simple health Q&A from local knowledge
- Firebase Auth: Email/Password
- Firestore: Collections
users,usernames(see Registration flow) - No remote APIs for doctors/medicines; data generated locally for demo purposes
- Notifications: Local only (no FCM)
Declared in AndroidManifest.xml:
POST_NOTIFICATIONS(Android 13+ runtime permission handled)CAMERA(runtime)RECORD_AUDIO(runtime)INTERNETACCESS_NETWORK_STATE
- Android Studio + JDK
- Android Studio (latest) and JDK 17 required (Gradle uses Java 17).
- Firebase
- File
app/google-services.jsonis required. Add your own from Firebase Console. - Enable Email/Password provider in Firebase Auth.
- Create Firestore database in your project.
- Optional: Set appropriate Firestore Security Rules for your use case.
- Google Maps API Key
- A key is referenced in
AndroidManifest.xmlvia<meta-data android:name="com.google.android.geo.API_KEY" ...>. - Best practice: move the key out of source (e.g.,
local.properties+ manifest placeholder) and restrict it to Android apps with your package + SHA-1/SHA-256.
- Package IDs
- Decide whether to keep
applicationIdascom.example.medicinetrackingappor align with thenamespace.
- Open project in Android Studio
- Sync Gradle
- Connect a device or start an emulator (API 24+)
- Run the
appconfiguration
Login tips
- This app expects Firebase Auth users. Register a new username to generate an account (
username@app.local).
- Maps not showing: Ensure a valid/restricted Maps API key and network access
- Firebase errors: Check
google-services.json, enabled providers, and Firestore rules - POST_NOTIFICATIONS denied: App will still show an in-app Snackbar if notifications are blocked
- Camera/Audio intents fail: Grant runtime permissions or test on a real device
- Namespace vs applicationId mismatch: Align before release to avoid Play Console confusion
- Place screenshots in
assets/screenshots/and short demo videos/gifs inassets/demo/ - Example (add your files):
- assets/screenshots/main.png
- assets/screenshots/doctors.png
- assets/demo/flow.mp4
© 2025 MedicineApp (demo). For learning and demonstration purposes only.