Skip to content

πŸ”” Smart doorbell companion app delivering instant notifications and activity insights on Android.

Notifications You must be signed in to change notification settings

dianaangan/KnockTrack

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

27 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

KnockTrack πŸ””

A smart doorbell companion app for Android that delivers real-time notifications, rich activity insights, and secure device control powered by Firebase.

Kotlin Android Studio Firebase License

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.


πŸ“‹ Table of Contents


🎯 Overview

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.

Key Highlights

  • πŸ” 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

✨ Features

🏠 Home Experience

  • 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

πŸ“œ History Insights

  • RecyclerView list of all recorded doorbell presses
  • Single-entry delete plus Clear All button styled consistently with primary actions
  • Real-time updates as events arrive or are removed in Firebase

βš™οΈ Settings Control

  • 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 SettingPresenter and SettingModel for clean separation of concerns

πŸ”” Notification System

  • GlobalAlertManager handles channel creation, vibration, and sound
  • Duplicate prevention using persisted event IDs tied to the authenticated user
  • Works whether the app is foregrounded or backgrounded

πŸ› οΈ Tech Stack

  • 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 NotificationCompat with channels and runtime permission checks

πŸ—οΈ Architecture

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.


πŸ“¦ Installation

Prerequisites

  • Android Studio Giraffe (or newer)
  • Android SDK 33+
  • JDK 17+
  • A Firebase project with Authentication and Realtime Database enabled

Steps

git clone https://github.com/dianaangan/KnockTrack.git
cd KnockTrack
  1. Open the project in Android Studio and let Gradle sync.
  2. Add your Firebase google-services.json to the app/ directory.
  3. Build and run on an emulator or physical device running Android 8.0+.

βš™οΈ Configuration

  • 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 BaseActivity for Android 13+.
  • Environment Secrets: Keep any API keys or service credentials outside of version control.

πŸš€ Usage

For end users

  1. Log in via Firebase Authentication.
  2. Connect a doorbell by entering a device ID and auth key in Settings.
  3. Receive push notifications and view analytics plus recent history on the Home screen.
  4. Review or delete individual entries in History, or clear the entire list when needed.

For developers

  1. Adjust presenters or models to customize business logic.
  2. Update drawables/layouts to refine the UI.
  3. Extend analytics by enhancing HistoryModel.getDoorbellAnalytics().

πŸ“ Project Structure

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.


🀝 Contributing

  1. Fork the repository.
  2. Create a feature branch (git checkout -b feature/amazing-improvement).
  3. Commit with descriptive messages.
  4. 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.

πŸ“ Notes

  • 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.

πŸ“„ License

This project is maintained privately by Diana Angan. Contact the owner for licensing or reuse discussions.


πŸ‘€ Author & Collaborators

  • Author: Diana Angan
    GitHub: @dianaangan

  • Collaborators:

    • Alek-alt
    • Elf (Eleftheria02)
    • jisaapyt1

πŸ™ Acknowledgments

  • 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!

About

πŸ”” Smart doorbell companion app delivering instant notifications and activity insights on Android.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •