Check your heart rate instantly using your phone's camera. This app uses advanced image processing to detect pulse variations from your fingertip.
The project follows the Clean Architecture pattern combined with MVVM (Model-View-ViewModel).
-
UI Layer (Jetpack Compose):
- Screens: Composable functions defining the UI for Heart Rate measurement and History.
- ViewModels: Manage UI state and interact with the Repository using Kotlin Coroutines and StateFlow.
-
Domain/Core Layer:
- HeartRate Engine: Core logic for pulse detection and timing.
- Camera Support: Interface-based camera handling (abstracting CameraX implementation).
- Processing: Image processing logic to extract red-channel average values from camera frames.
-
Data Layer:
- Repository: Orchestrates data flow between the local database and the UI.
- Room Database: Local persistence for storing heart rate measurement history.
- Language: Kotlin
- UI: Jetpack Compose (Modern Declarative UI)
- Dependency Injection: Hilt
- Asynchronous Programming: Kotlin Coroutines & Flow
- Database: Room
- Camera API: CameraX (Modern, lifecycle-aware camera handling)
- Unit Testing: JUnit 4, Mockito, Turbine (for Flow testing)
- Image Capture: The app uses CameraX to capture low-resolution frames at a high frequency.
- Processing: Each frame is processed to calculate the average "redness" of the fingertip.
- Pulse Detection: By tracking the subtle variations in the red channel over time (caused by blood flow), the app calculates the Beats Per Minute (BPM).
- Feedback: Real-time feedback is provided via a progress indicator and live BPM updates.
- Clone the repository.
- Open the project in Android Studio (Ladybug or newer recommended).
- Build and run the
appmodule on a physical device (Camera is required).



