XiaochangXu/HeartRateMonitor
About
这是一款心率监测应用,支持Android和Windows,基于蓝牙心率广播实时显示心率,支持悬浮窗、状态栏显示、触摸穿透、网络传输
Systems & InfrastructureMeasured star growth
- in 24h
- 0
- in 7 days
- +1
- in 15 days
- 0
- in 1 month
- Collecting history
Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.
README_EN.md
Original
Heart Rate Monitor
An Android heart rate monitoring app based on BLE (Bluetooth Low Energy) technology, plus a Windows desktop heart rate monitor — two platforms that work together.
What's this
A dual-platform app that reads your bracelet/watch heart rate in real time via **BLE Heart Rate Broadcast **(Standard Heart Rate Service UUID 0x180D).
After the bracelet/watch end turns on the heart rate broadcast, this application scans the connection and displays real-time BPM, supports floating window, status bar resident,
History charts, OBS browser feed overlays, and HTTP / WebSocket / Webhook data outputs.
Compatible devices
Any device that supports standard BLE heart rate service (0x180D), including but not limited to:
- Xiaomi bracelet/Xiaomi watch (turn on heart rate broadcast)
- Huawei bracelet/Huawei watch (Settings → Heart rate broadcast)
- Glory Bracelet/Glory Watch
- Amazfit / Zepp OS Watch (Heart Rate Push enabled)
- Garmin Watch (Broadcast Heart Rate enabled)
- Apple Watch (requires third-party broadcast apps)
- Polar / Wahoo / Coospo and other standard BLE heart rate bands
Project Overview
This repository contains two platform-specific applications with no shared code; they can be used together:
| Directory | Platform | Tech Stack |
|---|---|---|
android |
Android | Kotlin + Jetpack Compose |
windows |
Windows | .NET 10 + WinUI 3 |
Features
Android
- Full-Screen Mode: Immersive heart rate display, turning your phone into a cardiac monitor
- Bluetooth Connection: Scan and connect to BLE devices that support heart rate services
- Device Management: Favorite frequently used devices, with auto-connect and disconnect-reconnect support
- Heartbeat Animation: Dynamically changes based on heart rate
- Heart Rate History & Charts: Auto-recording, history list, batch management, chart analysis, landscape view
- Personalization: Feature toggles, floating window style customization
- Data Interfaces: HTTP server, WebSocket server, Webhook push
- OBS Browser Source Display: Built-in HTML page — add a browser source in OBS with the server address to display real-time heart rate, with customizable color, size, font, and more via URL parameters
- Floating Heart Rate Display: Shows your heart rate over any app on your phone screen
- Status Bar Heart Rate: Display real-time heart rate in the status bar
- Heart Rate Alert: Posture detection combined with threshold-based notifications and vibration
- Fair Memory Management: Adapted to domestic vendor memory management mechanisms
- Color Picker: Self-drawn HSV color wheel
- Smooth Transition Animations: Real-time blur scaling
- Liquid Glass Effect: Liquid glass effect for the bottom navigation bar
- Local Network Transmission: WebSocket server for PC and phone communication
- Material 3 Dynamic Color
Windows
- Bluetooth Heart Rate Monitoring: Scan and connect to Bluetooth heart rate devices, display real-time bpm
- Floating Window: A draggable desktop floating heart, with scaling, color, heartbeat animation, bpm unit display, click-through, and global hotkeys
- Appearance Settings: Scaling ratio, icon size, heart color, display items, heartbeat animation toggle, one-click reset
- Network & Transfer
- HTTP server: serves current heart rate as JSON
- WebSocket server: pushes heart rate data in real time
- Webhook: triggers custom HTTP callbacks on heart rate changes
- LAN transfer: mDNS broadcast + pairing, real-time sync with the phone (with port conflict detection)
- Multi-language: 简体中文 / English
- Version & Info Page: Shows current version and repository links
Screenshots
Android
![]() Real-time heart rate monitoring |
![]() History & chart analysis |
![]() Personalization & floating window |
![]() About and details |
Windows
Home
Installation & Running
Clone the repository:
git clone https://github.com/XiaochangXu/HeartRateMonitor-composeui.git
Android
- Open the project: Open the
androiddirectory with Android Studio - Wait for Gradle to automatically sync dependencies
- Build and run: Connect a real device or emulator (API ≥ 24), then click the ▶ Run button in the toolbar
Windows
Requirements: Windows 10/11, .NET 10 SDK, Windows App SDK 1.8 workload.
cd windows
dotnet build -c Debug
Run:
bin\Debug\net10.0-windows10.0.19041.0\win-x64\HeartRate.exe
If
dotnetis not in PATH, calldotnet.exewith its full path.Alternatively, extract the release package and double-click
HeartRate.exeto launch.
Usage Guide
Android
- Grant permissions: Allow Bluetooth and location permissions on first launch
- Connect a heart rate device: First enable heart rate broadcasting on the device, then tap the Scan button to select and connect
- View history: Tap the history icon in the toolbar to open the list, then tap an entry to view charts
- Use the floating window: Toggle from the home toolbar, customize appearance in Settings
- Status bar persistence: Settings → Status Bar Heart Rate, enable to show heart rate in the status bar
- Heart rate alerts: Settings → Heart Rate Alert, configure thresholds and posture calibration
- Data interfaces: Settings → Data & Services, configure HTTP/WebSocket/Webhook
- OBS heart rate display: Enable HTTP or WebSocket server, add a browser source in OBS with the address shown in the app (e.g.
http://<IP>:8001/), customize style via URL params (?color=#ff0000&size=80&unit=1)
Windows
- Extract the release package, enter the directory, and double-click
HeartRate.exeto launch
Tech Stack
Android
- Kotlin + Jetpack Compose
- Kable (BLE), Vico (Charts), Room (Database), MaterialKolor (Dynamic Color)
- NanoHTTPD (HTTP/WebSocket Server), PermissionX, AndroidLiquidGlass
Windows
- .NET 10 + WinUI 3 (Windows App SDK 1.8)
- CommunityToolkit.Mvvm (MVVM source generators)
- Direct2D / DirectComposition floating window rendering
- Self-contained unpackaged deployment
Project Structure
├── android/ # Android (Kotlin + Compose, multi-module)
│ ├── app/ # App shell: entry point, navigation, composition root (HeartRateApp @HiltAndroidApp + AppModule), Manifest
│ ├── core/
│ │ ├── model/ # Domain models (zero module dependencies)
│ │ ├── designsystem/ # Theme visuals & theme state (depends on :data:settings)
│ │ └── ui/ # Shared Compose components / animations / UI utils / routing / shared resources
│ ├── data/
│ │ ├── settings/ # DataStore settings storage + SettingsRepository
│ │ ├── database/ # Room (Entity/DAO/AppDatabase)
│ │ └── repository/ # Repository layer + webhook/network/sensor/system
│ ├── service/ # BLE / foreground / floating window / alert / LAN services
│ ├── feature/ # Feature modules: main / settings / history / alarm / server / webhook / favorite
│ ├── baselineprofile/ # Baseline profile (com.android.test)
│ ├── skill/ # Project rules: SKILL.md index + docs/contracts (13 contracts) + docs/baseline
│ └── baseline/ # Multi-modularization baseline archive
├── windows/ # Windows (C# + WinUI 3)
├── .github/workflows/ # Release pipelines: release-android.yml / release-windows.yml
├── LICENSE
└── README.md
Acknowledgements
Core Dependencies (Android)
- UI Framework: Jetpack Compose · Material 3
- Bluetooth: Kable
- Charts: Vico
- Database: Room
- Dynamic Color: MaterialKolor
- HTTP/WebSocket Server: NanoHTTPD
- Permissions: PermissionX
- Liquid Glass: AndroidLiquidGlass
- G2 Capsule: Capsule
Roadmap
Core Features
- BLE heart-rate device scanning & connection
- Heart-rate history & chart analysis
- Floating window / status-bar persistent heart rate
- HTTP / WebSocket / Webhook data interfaces
- OBS browser source heart rate display (built-in HTML page + dual-mode auto-switching)
- Heart-rate alert + posture detection
- Material 3 dynamic color
- Self-drawn HSV color picker
- WebSocket server for PC and phone communication
License
MIT © 2026 XiaochangXu
Explore related projects
Loading…



