A smart doorbell companion app for Android that delivers real-time notifications, rich activity insights, and secure device control powered by Firebase.
KnockTrack turns each doorbell press into an actionable alert while keeping homeowners informed with a minimalist dashboard, analytics, and history controlsβall backed by a clean MVP codebase.
- Overview
- Highlights
- Features
- Tech Stack
- Architecture
- Installation
- Configuration
- Usage
- Project Structure
- Contributing
- Notes
- License
- Author
- Acknowledgments
KnockTrack is a Kotlin-based Android application that monitors a smart doorbell through Firebase Realtime Database. The app delivers phone notifications, mirrors events in real time on the Home and History screens, and offers lightweight analytics so users can quickly gauge recent activity.
- π Secure access via Firebase Authentication with guarded back navigation
- π² Mobile notifications with duplicate suppression and Android 13+ permission handling
- β±οΈ Real-time UI refresh across Home and History without manual reloads
- ποΈ History management featuring per-item delete and
Clear All - βοΈ Settings workflow that disables inputs when connected and enforces consistent button styles
- π¨ Minimalist design language with shared headers, borders, and typography
- Welcome header with contextual status, connection indicator, and quick βSign Outβ action
- Analytics overview showing all-time, today, and current-week doorbell counts
- Recent Activity feed with bordered items, timestamps, and empty-state messaging
- RecyclerView list of all recorded doorbell presses
- Single-entry delete plus
Clear Allbutton styled consistently with primary actions - Real-time updates as events arrive or are removed in Firebase
- Device ID and Auth Key fields that become read-only and greyed out when a device is connected
- "Connect" / "Reset" actions with guardrails to avoid accidental edits
- SharedPreferences persistence so states survive app restarts
- Full MVP architecture with
SettingPresenterandSettingModelfor clean separation of concerns
GlobalAlertManagerhandles channel creation, vibration, and sound- Duplicate prevention using persisted event IDs tied to the authenticated user
- Works whether the app is foregrounded or backgrounded
- Language: Kotlin + Coroutines
- Architecture: ModelβViewβPresenter (MVP)
- Backend: Firebase Authentication & Realtime Database
- UI: Android XML layouts with custom drawables and Material-inspired styling
- Notifications: Android
NotificationCompatwith channels and runtime permission checks
KnockTrack follows MVP to keep UI, logic, and data concerns isolated:
- View (Activities + Interfaces):
HomeActivity,HistoryActivity,SettingActivity, etc., implementing their respective View interfaces (HomeView,HistoryView,SettingView). - Presenter: Mediates between views and models, e.g.,
HomePresenter,HistoryPresenter,SettingPresenter,LoginPresenter,RegisterPresenter. - Model: Talks to Firebase and local storage (
HistoryModel,DoorbellModel,HomeModel,SettingModel,LoginModel,RegisterModel). - Utilities:
GlobalAlertManager,GlobalFirebaseListener, SharedPreferences helpers.
This structure keeps business rules testable and lets UI layers focus on rendering. All screens consistently follow the MVP pattern for maintainability and scalability.
- Android Studio Giraffe (or newer)
- Android SDK 33+
- JDK 17+
- A Firebase project with Authentication and Realtime Database enabled
git clone https://github.com/dianaangan/KnockTrack.git
cd KnockTrack- Open the project in Android Studio and let Gradle sync.
- Add your Firebase
google-services.jsonto theapp/directory. - Build and run on an emulator or physical device running Android 8.0+.
- Firebase Database Path:
devices/{deviceId}/events(customize in models if needed). - SharedPreferences: Stores connection details and notification history per user.
- Notification Permissions: Prompt handled in
BaseActivityfor Android 13+. - Environment Secrets: Keep any API keys or service credentials outside of version control.
For end users
- Log in via Firebase Authentication.
- Connect a doorbell by entering a device ID and auth key in Settings.
- Receive push notifications and view analytics plus recent history on the Home screen.
- Review or delete individual entries in History, or clear the entire list when needed.
For developers
- Adjust presenters or models to customize business logic.
- Update drawables/layouts to refine the UI.
- Extend analytics by enhancing
HistoryModel.getDoorbellAnalytics().
app/src/main/java/com/knocktrack/knocktrack/
βββ adapter/ # RecyclerView adapters (DoorbellEventAdapter, etc.)
βββ model/ # Firebase + persistence logic
β βββ DoorbellModel.kt
β βββ HistoryModel.kt
β βββ HomeModel.kt
β βββ LoginModel.kt
β βββ RegisterModel.kt
β βββ SettingModel.kt
βββ presenter/ # MVP presenters coordinating UI + data
β βββ HistoryPresenter.kt
β βββ HomePresenter.kt
β βββ LoginPresenter.kt
β βββ RegisterPresenter.kt
β βββ SettingPresenter.kt
βββ service/ # Firebase authentication service
β βββ FirebaseAuthService.kt
βββ utils/ # GlobalAlertManager, Firebase listeners, helpers
β βββ GlobalAlertManager.kt
β βββ GlobalFirebaseListener.kt
βββ view/ # Activities implementing MVP contracts
βββ BaseActivity.kt
βββ HistoryActivity.kt
βββ HistoryView.kt
βββ HomeActivity.kt
βββ HomeView.kt
βββ LandingPageActivity.kt
βββ LoginActivity.kt
βββ LoginView.kt
βββ RegisterActivity.kt
βββ RegisterView.kt
βββ SettingActivity.kt
βββ SettingView.kt
Resources are located in app/src/main/res/ and include layout XMLs, drawables, colors, and strings.
- Fork the repository.
- Create a feature branch (
git checkout -b feature/amazing-improvement). - Commit with descriptive messages.
- Push and open a pull request describing changes, screenshots (for UI tweaks), and test steps.
Development guidelines:
- Keep MVP boundaries clear.
- Match the established design tokens (colors, typography, spacing).
- Add or update tests/presenter logic when touching Firebase interactions.
- Notification Duplication: Prevented through persisted event IDs per user session.
- Back Navigation: Login/Home flows clear task stacks and override
onBackPressed()for predictable UX. - Offline Behavior: The app relies on Firebase; add caching if offline support is required.
- Security: Rotate credentials regularly and secure any shipped builds before distribution.
This project is maintained privately by Diana Angan. Contact the owner for licensing or reuse discussions.
-
Author: Diana Angan
GitHub: @dianaangan -
Collaborators:
- Alek-alt
- Elf (Eleftheria02)
- jisaapyt1
- Built with Android best practices and Firebaseβs real-time capabilities.
- Inspired by minimalist, utility-first UI patterns for smart-home apps.
- Thanks to everyone who provided feedback on UX and notification behavior.
βοΈ If KnockTrack helps you build better doorbell experiences, consider starring the repository!