Introduction
The Open Wearables Android SDK (open-wearables-android-sdk) is a native Kotlin SDK for secure background synchronization of health data from Samsung Health and Health Connect to the Open Wearables platform.
This is the core native implementation that powers health data sync on Android. The Flutter SDK uses this SDK under the hood as a wrapper.
GitHub Repository
View source code, report issues, and contribute to the Android SDK.
Features
- Dual Provider Support - Samsung Health and Health Connect in a single SDK
- Background Sync - Health data syncs via WorkManager with foreground service for reliability
- Resumable Sessions - Sync sessions survive app restarts
- Dual Authentication - Token-based auth with auto-refresh on 401, or API key authentication
- Secure Storage - Credentials stored in Android EncryptedSharedPreferences
- Incremental Updates - Only syncs new data using anchored queries
- Unified Payload - Consistent data format regardless of provider
- Wide Data Support - Steps, heart rate, workouts, sleep, and more
Requirements
| Requirement | Details |
|---|---|
| Min SDK | Android 10 (API 29+) |
| Compile SDK | 36 |
| Java | 17 |
| Kotlin | 2.1.0+ |
| Samsung Health SDK | For Samsung Health provider |
| Health Connect | For Health Connect provider |
Installation
Add the SDK via JitPack. In your rootbuild.gradle.kts (or settings.gradle.kts):
build.gradle.kts:
Android Configuration
The SDK’sAndroidManifest.xml automatically merges the required permissions and services. However, ensure your app’s build.gradle.kts has the correct SDK versions:
Permissions
The SDK declares these permissions automatically (merged via manifest):Declared permissions
Declared permissions
| Permission | Purpose |
|---|---|
FOREGROUND_SERVICE | Foreground service during sync |
FOREGROUND_SERVICE_DATA_SYNC | Data sync foreground service type |
POST_NOTIFICATIONS | Sync notification (Android 13+) |
INTERNET | Network access |
ACCESS_NETWORK_STATE | Network monitoring |
health.READ_HEALTH_DATA_IN_BACKGROUND | Background health data access |
health.READ_STEPS | Step count |
health.READ_HEART_RATE | Heart rate |
health.READ_RESTING_HEART_RATE | Resting heart rate |
health.READ_HEART_RATE_VARIABILITY | HRV |
health.READ_OXYGEN_SATURATION | Blood oxygen |
health.READ_BLOOD_PRESSURE | Blood pressure |
health.READ_BLOOD_GLUCOSE | Blood glucose |
health.READ_ACTIVE_CALORIES_BURNED | Active energy |
health.READ_BASAL_METABOLIC_RATE | Basal energy |
health.READ_BODY_TEMPERATURE | Body temperature |
health.READ_WEIGHT | Body mass |
health.READ_HEIGHT | Height |
health.READ_BODY_FAT | Body fat percentage |
health.READ_LEAN_BODY_MASS | Lean body mass |
health.READ_FLOORS_CLIMBED | Flights climbed |
health.READ_DISTANCE | Walking/running distance |
health.READ_HYDRATION | Water intake |
health.READ_VO2_MAX | VO2 max |
health.READ_RESPIRATORY_RATE | Respiratory rate |
health.READ_EXERCISE | Workouts |
health.READ_SLEEP | Sleep data |
Quick Start
Here’s the minimal code to get health sync working:Activity Setup
The SDK needs a reference to the currentActivity for permission dialogs (especially Health Connect):
Documentation
Integration Guide
Complete guide to integrating the SDK including authentication flow, backend setup, and best practices.
Troubleshooting
Common issues and their solutions for Android.
Provider Selection
The SDK supports two health data providers on Android:| Provider | ID | Description |
|---|---|---|
| Health Connect | "google" | Google’s Health Connect API. Works on all Android 10+ devices. |
| Samsung Health | "samsung" | Samsung Health SDK. Works on Samsung devices with Samsung Health installed. |
Supported Health Data Types
- Health Connect
- Samsung Health
| Type ID | Description |
|---|---|
steps | Step count |
heartRate | Heart rate |
restingHeartRate | Resting heart rate |
heartRateVariabilitySDNN | HRV (SDNN) |
oxygenSaturation | Blood oxygen |
vo2Max | VO2 max |
respiratoryRate | Respiratory rate |
bloodPressure | Blood pressure (systolic + diastolic) |
bloodGlucose | Blood glucose |
activeEnergy | Active calories burned |
basalEnergy | Basal metabolic rate |
bodyTemperature | Body temperature |
bodyMass | Weight |
height | Height |
bodyFatPercentage | Body fat % |
leanBodyMass | Lean body mass |
flightsClimbed | Floors climbed |
distanceWalkingRunning | Walking/running distance |
distanceCycling | Cycling distance |
water / dietaryWater | Water intake |
workout | All workout types with segments, laps, route, samples |
sleep | Sleep sessions with stages (awake, light, deep, REM) |
Health Connect generally supports more data types than Samsung Health. If both are available, Health Connect is recommended for the widest data coverage.
Next Steps
Integration Guide
Complete step-by-step integration guide.
Flutter SDK
Using Flutter? The Flutter SDK wraps this native SDK for cross-platform apps.

