A role-based Android application for managing clinic appointments, patient histories, and medical billing — powered by Firebase.
Submitted for CS-512 Mobile App Development
University of Agriculture, Faisalabad
Instructor: Prof. Waseem
- 🔐 Registration — Secure email/password sign-up via Firebase Authentication
- 🏠 Dashboard — Profile overview with quick navigation to all patient features
- 📅 Book Appointments — Schedule visits with doctor name, date/time picker, and problem description
- 🧾 Bills History — Review itemized medical bills from completed appointments
- 💊 Treatment History — Access diagnosis, prescription, and progress records in one place
- 🏠 Dashboard — Central hub with profile, specialization, and navigation shortcuts
- ⏳ Manage Pending Appointments — Review incoming patient booking requests in real time
- ✅ Accept / Reject Appointments — Approve or decline scheduled visits with one tap
- 🩺 Clinical Records — Record diagnosis, prescription, and treatment progress per visit
- 💰 Automated Billing — Generate itemized bills with consultation and medicine fees
- 🔑 Firebase Authentication — Industry-standard email/password auth with secure session management
- 🎭 Role-Based Routing — Post-login navigation driven by user role (
patientordoctor)
graph TD
A[🚀 LoginRegisterActivity] --> B{Select Role}
B -->|Patient| C[📄 PatientRegisterActivity]
B -->|Doctor| D[📄 DoctorRegisterActivity]
B -->|Login| E[🔐 LoginActivity]
E --> F{Read role from Firebase}
F -->|patient| G[🏠 PatientHomeActivity]
G --> H[📅 Book Appointment]
G --> I[💊 Treatment History]
G --> J[🧾 Bills History]
F -->|doctor| K[🏠 DoctorProfileActivity]
K --> L[⏳ Pending Appointments]
K --> M[📅 Today's Appointments]
K --> N[📚 Patient History]
L --> O[✅ AppointmentActionActivity]
M --> O
O -->|Accept| P[📝 AppointmentDetailActivity]
P --> Q[💰 Complete & Generate Bill]
| Role Selection | Patient Registration | Patient Dashboard |
|---|---|---|
![]() |
![]() |
![]() |
| Doctor Registration | Doctor Dashboard | Appointment Action |
|---|---|---|
![]() |
![]() |
![]() |
| Today's Appointments | Treatment & Billing | |
|---|---|---|
![]() |
![]() |
| Role | Access | Key Features |
|---|---|---|
| 👤 Patient | Patient Home, Booking, History screens | Register & login · View profile · Book appointments · Treatment history · Bills history |
| 🩺 Doctor | Doctor Dashboard, Appointment management, Clinical tools | Register & login · Pending appointments · Accept/reject visits · Update treatment · Generate bills · Patient history |
Frontend
- XML layouts · Material Design Components · CardView · RecyclerView · ConstraintLayout
Backend
- Firebase Authentication (Email/Password) · Firebase Realtime Database
Language
- Java 11
Tools
- Android Studio · Gradle · Google Services Plugin
1. Clone the repository
git clone https://github.com/YOUR_USERNAME/MedicalManagementSystem.git
cd MedicalManagementSystem2. Configure Firebase
- Create a project at the Firebase Console
- Enable Email/Password sign-in under Authentication
- Create a Realtime Database and apply security rules
- Register an Android app with package name
com.medical.app - Download
google-services.jsonand place it in theapp/directory
3. Build & Run
./gradlew assembleDebugOpen the project in Android Studio, connect a device or launch an emulator, and click Run ▶.
⚠️ Critical: Ensure you place yourgoogle-services.jsonfile inside theapp/directory before building.
- Secure Setup Directory — Confirm
google-services.jsonis inapp/and excluded from version control - Update Firebase Rules — Apply authenticated, role-aware security rules in the Realtime Database
- Test All User Workflows — Verify Patient and Doctor registration, booking, treatment, and billing flows end-to-end
Through building MedSync, the following academic competencies were demonstrated:
- 🔥 Firebase Integration — End-to-end setup of Authentication and Realtime Database with live data listeners
- 📋 RecyclerView & CardView — Dynamic list rendering for appointments, history, and billing screens
- 🎭 Role-Based Authentication — Dual-portal routing based on user role stored in the cloud
- 🎨 Material Design UI — Consistent theming, input fields, buttons, and card-based layouts in XML
- 📄 PDF Bill Generation — Export and share itemized medical bills as downloadable PDF documents
- 🔔 Push Notifications — Appointment reminders, accept/reject alerts, and bill confirmations via FCM
- 📹 Video Consultations — In-app telemedicine sessions between patients and doctors
- 💬 In-App Messaging — Secure chat channel for pre- and post-appointment communication
Aliza Tariq
University of Agriculture, Faisalabad
Department of Computer Science
Course: CS-512 — Mobile App Development
Instructor: Prof. Waseem
Made with ❤️ using Android Studio & Firebase







