DCdmitry-chernenko.meAll projects
ENRU
Home/projects/health-sdk
FEATUREDdmitry/health-sdk

Unified Health SDK

Dirion · Senior Android · 2024 — Now

A unified Health SDK bridging Google Fit, Health Connect & Huawei Health — one API with fallback logic, reused across 3 company products.

{ } Repository
3
apps
+50%
Huawei sync
60%
duplication
// Context

Three products each re-implemented step and workout sync against Google Fit, Health Connect and Huawei Health — duplicated code, inconsistent behaviour and fragile Huawei support.

// What I built
+Designed one Health SDK exposing a single Flow-based API over all providers
+Added fallback logic that picks the first available provider and retries
+Built a unified permission manager to remove per-app boilerplate
+Wrote an integration guide so teams adopt it in hours
sdk/HealthRepository.kt
-fun steps() = googleFit.read(STEPS)
+fun steps(): Flow<Steps> = providers
+ .firstAvailable(Fit, HealthConnect, Huawei)
+ .read(STEPS).retryWithFallback()
// Result
Reused across 3 company products
+50% Huawei sync stability
−60% code duplication
// Stack
KotlinKMPCoroutines / FlowHealth ConnectGoogle FitHuawei Health
{ } RepositoryAll projects