Skip to main content

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

Installation

Add the SDK via JitPack. In your root build.gradle.kts (or settings.gradle.kts):
Then add the dependency in your app’s build.gradle.kts:

Android Configuration

The SDK’s AndroidManifest.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):

Quick Start

Here’s the minimal code to get health sync working:

Activity Setup

The SDK needs a reference to the current Activity 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:

Supported Health Data Types

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.