Health Connect to Webhook (Beta)
An Android application that seamlessly connects Health Connect data to your webhooks, enabling automated health data synchronization to your custom endpoints.
Overview
HC Webhook is a powerful Android app that bridges the gap between Google Health Connect and your webhook infrastructure. It automatically reads health data from Health Connect and sends it to your configured webhook URLs at customizable intervals, making it easy to integrate health data into your own systems, analytics platforms, or third-party services.
Features
- ๐ Automated Background Sync - Configurable sync intervals (minimum 15 minutes) using WorkManager
- ๐ฏ Selective Data Types - Choose which health data types to sync (17 supported types)
- ๐ **Multiple Wโฆ
Health Connect to Webhook (Beta)
An Android application that seamlessly connects Health Connect data to your webhooks, enabling automated health data synchronization to your custom endpoints.
Overview
HC Webhook is a powerful Android app that bridges the gap between Google Health Connect and your webhook infrastructure. It automatically reads health data from Health Connect and sends it to your configured webhook URLs at customizable intervals, making it easy to integrate health data into your own systems, analytics platforms, or third-party services.
Features
- ๐ Automated Background Sync - Configurable sync intervals (minimum 15 minutes) using WorkManager
- ๐ฏ Selective Data Types - Choose which health data types to sync (17 supported types)
- ๐ Multiple Webhooks - Send data to multiple webhook URLs simultaneously
- ๐ Manual Sync - Trigger immediate data synchronization on demand
- ๐ Webhook Logs - View detailed logs of all webhook requests and responses
- ๐ Permission Management - Granular Health Connect permission handling
- ๐จ Modern UI - Built with Jetpack Compose and Material 3 design
- โก Real-time Status - Visual indicators for permission status and sync state
Supported Health Data Types
The app supports reading and syncing the following health data types from Health Connect:
- Steps - Daily step count
- Sleep - Sleep sessions with stages
- Heart Rate - Heart rate measurements
- Distance - Distance traveled
- Active Calories - Calories burned during activity
- Total Calories - Total calories burned
- Weight - Body weight measurements
- Height - Height measurements
- Blood Pressure - Systolic and diastolic readings
- Blood Glucose - Blood glucose levels
- Oxygen Saturation - SpO2 measurements
- Body Temperature - Body temperature readings
- Respiratory Rate - Breathing rate measurements
- Resting Heart Rate - Resting heart rate data
- Exercise Sessions - Workout and exercise data
- Hydration - Water intake tracking
- Nutrition - Nutritional information (calories, protein, carbs, fat)
Requirements
- Android 8.0 (API 26) or higher
- Google Health Connect app installed and set up
- Internet connection for webhook delivery
Installation
From Source
- Clone this repository:
git clone https://github.com/mcnaveen/health-connect-webhook
cd health-connect-webhook
Open the project in Android Studio (Arctic Fox or later recommended) 1.
Sync Gradle dependencies 1.
Build and run the app on your device or emulator
Building the APK
./gradlew assembleDebug
The APK will be generated at: app/build/outputs/apk/debug/app-debug.apk
Usage
Initial Setup
Install Health Connect (if not already installed)
- Download from Google Play Store
Grant Permissions
- Open the app and tap "Grant Permissions"
- Select the health data types you want to sync
- Grant the required permissions in Health Connect
Configure Webhooks
- Add one or more webhook URLs (must start with
http://orhttps://) - Select which data types to sync
- Set your preferred sync interval (minimum 15 minutes)
Save Configuration
- Tap "Save Configuration" to start automatic syncing
Manual Sync
- Tap the "Sync Now" button in the Manual Sync section to immediately sync all enabled data types to your webhooks
Viewing Logs
- Access webhook logs from the menu (โฎ) โ "Webhook Log"
- View detailed information about each webhook request, including timestamps, status codes, and response data
Configuration
Sync Interval
- Minimum: 15 minutes
- Recommended: 30-60 minutes for most use cases
- The app uses WorkManager for reliable background syncing
Webhook Format
The app sends health data to your webhooks in JSON format. Each webhook request includes:
- Timestamp of the sync
- Data type information
- Health data records (filtered to only include new data since last sync)
- Metadata about the sync operation
โ ๏ธ Warning: Internet retry functionality is not implemented yet. If a webhook request fails due to network issues, the app will not automatically retry. Use at your own risk.
Data Privacy
- All health data remains on your device until explicitly sent to your configured webhooks
- The app only reads data that you explicitly grant permission for
- No data is sent to third-party services except your configured webhooks
- You can revoke permissions at any time through Android settings
Known Limitations
- โ ๏ธ Internet Retry Not Implemented - The app does not currently implement automatic retry logic for failed webhook requests due to network issues. If a sync fails due to internet connectivity problems, it will not be automatically retried. This feature may be added in future releases. Use at your own risk.
- โ ๏ธ No Day Limitation - There is currently no limitation on the date range or number of days of historical data that can be synced. This may result in large data transfers for users with extensive health data history. Use at your own risk.
Technical Details
Architecture
- Language: Kotlin
- UI Framework: Jetpack Compose
- Health Data: Health Connect SDK (AndroidX)
- Background Work: WorkManager
- Networking: OkHttp
- Serialization: Kotlinx Serialization
Key Components
MainActivity- Main configuration UIHealthConnectManager- Handles Health Connect data readingSyncManager- Manages data synchronization logicSyncWorker- Background worker for periodic syncingWebhookManager- Handles webhook HTTP requestsPreferencesManager- Manages app configuration and preferencesLogsActivity- Displays webhook request/response logs
Permissions
The app requires the following permissions:
- Health Connect read permissions (for each selected data type)
READ_HEALTH_DATA_IN_BACKGROUND- For background data accessINTERNET- For webhook delivery
Development
Project Structure
app/
โโโ src/
โ โโโ main/
โ โ โโโ java/com/hcwebhook/app/
โ โ โ โโโ MainActivity.kt # Main UI
โ โ โ โโโ HealthConnectManager.kt # Health Connect integration
โ โ โ โโโ SyncManager.kt # Sync logic
โ โ โ โโโ SyncWorker.kt # Background worker
โ โ โ โโโ WebhookManager.kt # Webhook HTTP client
โ โ โ โโโ PreferencesManager.kt # Configuration storage
โ โ โ โโโ LogsActivity.kt # Log viewer
โ โ โ โโโ AboutActivity.kt # About screen
โ โ โโโ res/ # Resources
โ โโโ test/ # Unit tests
โโโ build.gradle.kts # App-level build config
Building
# Debug build
./gradlew assembleDebug
# Release build
./gradlew assembleRelease
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'feat: Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
License
Source Code Only - All Rights Reserved
This project is provided as source code for personal use and educational purposes only.
Restrictions:
- โ No Republishing - You may not republish, redistribute, or share this code in any form
- โ No Monetization - You may not use this code for commercial purposes or monetize any derivative works
- โ Source Code Only - This repository contains source code only, not a published application
You are permitted to:
- View and study the source code
- Build and use the application for personal use
- Learn from the implementation
Any other use requires explicit written permission from the author.
Privacy & Security
- HC Webhook does not collect, store, or transmit any personal data to third-party services
- All health data remains on your device until sent to your configured webhooks
- Webhook URLs are stored locally on your device
- You have full control over which data types are synced and where they are sent
Support
For issues, feature requests, or questions, please open an issue on GitHub.
Acknowledgments
- Built with Health Connect by Google
- UI designed with Jetpack Compose
- Powered by WorkManager for reliable background processing
Note: This app requires Health Connect to be installed and properly configured on your device. Health Connect is available on Android 14+ devices or can be installed from the Play Store on compatible devices.