How the-momentum/open_wearables_android_sdk works
Open Wearables Android SDK lets an Android app authorize access to Samsung Health or Health Connect, read and normalize health records, then sync them to a backend. Its facade manages configuration, provider choice, authentication, permissions, and sync controls; SyncManager performs incremental/resumable uploads, while WorkManager runs syncs in the background. The README also documents token refresh, API-key auth, encrypted credentials, and foreground operation. Some implementation details—especially mTLS configuration and unsampled modules—are represented only where the README or source index supports them.
Main entry points: OpenWearablesHealthSDK.kt SDK Facade · SamsungHealthManager.kt Samsung Health · SyncManager.kt Sync Manager · HealthDataProvider.kt Provider Interface
Components 19
SDK API
- SDK Facade
sdk/src/main/kotlin/com/openwearables/health/sdk/OpenWearablesHealthSDK.kt
Health Providers
- Provider Interface
sdk/src/main/kotlin/com/openwearables/health/sdk/HealthDataProvider.kt - Health Connect
sdk/src/main/kotlin/com/openwearables/health/sdk/HealthConnectManager.kt - Samsung Health
sdk/src/main/kotlin/com/openwearables/health/sdk/SamsungHealthManager.kt - Unified Payload
sdk/src/main/kotlin/com/openwearables/health/sdk/UnifiedPayload.kt - Timestamp Checks
sdk/src/main/kotlin/com/openwearables/health/sdk/TimestampSanity.kt - Aggregate Windows
sdk/src/main/kotlin/com/openwearables/health/sdk/SamsungAggregateWindow.kt - Exercise Mapping
sdk/src/main/kotlin/com/openwearables/health/sdk/SamsungExerciseType.kt - Provider Outcomes
sdk/src/main/kotlin/com/openwearables/health/sdk/Outcome.kt - Samsung Models
sdk/src/main/kotlin/com/openwearables/health/sdk/SamsungModels.kt
Sync Runtime
- Sync Manager
sdk/src/main/kotlin/com/openwearables/health/sdk/SyncManager.kt - Background Worker
sdk/src/main/kotlin/com/openwearables/health/sdk/HealthSyncWorker.kt - Coroutine Dispatchers
sdk/src/main/kotlin/com/openwearables/health/sdk/DispatcherProvider.kt
Auth and Security
- Encrypted Storage
sdk/src/main/kotlin/com/openwearables/health/sdk/SecureStorage.kt - Auth Policy
sdk/src/main/kotlin/com/openwearables/health/sdk/SyncAuth.kt - mTLS Setup
sdk/src/main/kotlin/com/openwearables/health/sdk/MtlsConfigurator.kt - KeyChain Certs
sdk/src/main/kotlin/com/openwearables/health/sdk/KeyChainCertProvider.kt
Other components
- Android App
- Backend API
Connections 25
- Android App → SDK Facade: configures SDK
README.md - SDK Facade → Provider Interface: selects provider
sdk/src/main/kotlin/com/openwearables/health/sdk/OpenWearablesHealthSDK.kt - SDK Facade → Sync Manager: controls sync
sdk/src/main/kotlin/com/openwearables/health/sdk/OpenWearablesHealthSDK.kt - SDK Facade → Encrypted Storage: stores credentials
sdk/src/main/kotlin/com/openwearables/health/sdk/OpenWearablesHealthSDK.kt - SDK Facade → mTLS Setup: configures TLS
sdk/src/main/kotlin/com/openwearables/health/sdk/OpenWearablesHealthSDK.kt - SDK Facade → Auth Policy: uses auth policy
sdk/src/main/kotlin/com/openwearables/health/sdk/OpenWearablesHealthSDK.kt - SDK Facade → KeyChain Certs: selects certificate
sdk/src/main/kotlin/com/openwearables/health/sdk/OpenWearablesHealthSDK.kt - Provider Interface → Health Connect: implemented by
README.md - Provider Interface → Samsung Health: implemented by
README.md - Health Connect → Unified Payload: normalizes records
- Samsung Health → Unified Payload: normalizes records
- Health Connect → Timestamp Checks: checks timestamps
sdk/src/main/kotlin/com/openwearables/health/sdk/HealthConnectManager.kt - Samsung Health → Timestamp Checks: checks timestamps
sdk/src/main/kotlin/com/openwearables/health/sdk/SamsungHealthManager.kt - Samsung Health → Aggregate Windows: uses windows
sdk/src/main/kotlin/com/openwearables/health/sdk/SamsungHealthManager.kt - Samsung Health → Exercise Mapping: maps exercises
sdk/src/main/kotlin/com/openwearables/health/sdk/SamsungHealthManager.kt - Samsung Health → Provider Outcomes: returns outcomes
sdk/src/main/kotlin/com/openwearables/health/sdk/SamsungHealthManager.kt - Sync Manager → Provider Interface: reads data
README.md - Sync Manager → Encrypted Storage: persists sync state
sdk/src/main/kotlin/com/openwearables/health/sdk/SyncManager.kt - Sync Manager → Backend API: uploads payloads
README.md - Sync Manager → Coroutine Dispatchers: dispatches work
sdk/src/main/kotlin/com/openwearables/health/sdk/SyncManager.kt - Background Worker → Sync Manager: runs sync
sdk/src/main/kotlin/com/openwearables/health/sdk/HealthSyncWorker.kt - Background Worker → Encrypted Storage: loads credentials
sdk/src/main/kotlin/com/openwearables/health/sdk/HealthSyncWorker.kt - Background Worker → Provider Interface: creates provider
sdk/src/main/kotlin/com/openwearables/health/sdk/HealthSyncWorker.kt - mTLS Setup → KeyChain Certs: uses client certs
- Samsung Health → Samsung Models: uses models