Changelog
4.1.0
New Features
Sleep Apnea
The SleepSummary uploaded to ROOK servers now contains detection signs of sleep apnea; DETECTED, NOT_DETECTED or
UNDEFINED in the non_structured_data section of the SleepSummary JSON. Please note that
SamsungHealthPermission.SLEEP_APNEA is required to enable this behavior.
New Exceptions
SamsungHealthNotAllowedExceptionthis will be thrown when the consumer app is not allowed to use Samsung Health. ( ACCESS CONTROL: 2003). To fix it submit your package name and signing key for a partnership in Samsung Developer Portal. In case of testing the app enable developer mode on Samsung Health Settings.
Summaries Sync
RookSamsung.sync(enableLogs: Boolean) and RookSamsungObject.sync(context: Context, enableLogs: Boolean) now use an
expedited worker to increase the sync process resilience. This is an internal change, no migration is required.
On Android 11 or lower the sync worker will fall back to a foreground service with a temporal notification. You can
customize the notification through the AndroidManifest file:
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<application>
<meta-data
android:name="io.tryrook.samsung.sync.notification.ICON"
android:resource="@drawable/sync_notification_icon"/>
<meta-data
android:name="io.tryrook.samsung.sync.notification.TITLE"
android:resource="@string/sync_notification_title"/>
<meta-data
android:name="io.tryrook.samsung.sync.notification.CONTENT"
android:resource="@string/sync_notification_content"/>
</application>
</manifest>
Alarms, Battery Optimizations and OEM Auto Start
Some phone manufactures add their own energy restriction on top of Android's, these restrictions are mostly enabled by default and depending on the device will add a delay to background sync or even stopping it completely.
We have added 3 optimization paths to RookSamsung and RooksamsungObject to help you to ask your users optimizing
your application performance:
- Alarms
checkExactAlarmPermissions: Checks if theSCHEDULE_EXACT_ALARMpermission is granted. (Android 11 or lower always returnstrue)requestExactAlarmPermissions: Request theSCHEDULE_EXACT_ALARMpermission. (Android 11 or lower always returnsALREADY_GRANTED)
- Battery Optimizations
checkBatteryOptimizationsDisabled: Checks if battery optimizations are disabled.requestDisableBatteryOptimizations: Opens the system dialog that lets the user disable battery optimizations.
- Auto Start
requiresOemAutoStartSetup: Checks if current device belongs to an OEM that enforces a proprietary auto start restriction.openOemAutoStartSetup: Opens the OEM-specific auto start settings screen.
Check the Optimization permissions documentation to see more.
Background Sync
- Removed low battery constraint.
- Removed low storage constraint.
- Added a watchdog to check Background Sync liveness and re-schedule if necessary. No extra permissions required (
You'll need to call
RookSamsung.schedule/RookSamsungObject.scheduleagain to activate this behavior). - Added an alarm to check Background Sync liveness and re-schedule if necessary. Alarms permission required (You'll
need to call
RookSamsung.schedule/RookSamsungObject.scheduleafter granting alarm permissions to activate this behavior).
Medical Devices
This update improves the context sent with Samsung Health medical readings by attaching the device source used to capture the data when that information is available.
The following events include the device source metadata:
- Blood glucose
- Blood pressure
- Oxygenation (Resting/Active)
- Temperature
Device source metadata can include one or all of the following properties:
- Device manufacturer
- Device model
- Device/app source identifier
Behavior Changes
updateUserIDnow trims it's input before attempting to register, a string like " userID " will become "userID". If the trimmed string is emptyIllegalStateExceptionwill be returned.
New AAR
The Samsung Health Data AAR has been upgraded to 1.1.0
version, download and update your dependencies:
dependencies {
implementation("io.tryrook.android:rook-sdk-samsung:4.1.0")
implementation(files("$rootDir/libs/samsung-health-data-api-1.1.0.aar"))
// Used by Samsung Health Data AAR:
implementation("com.google.code.gson:gson:2.13.2")
}
Dependency updates
- androidx.work:work-runtime: New → 2.11.2
- androidx.work:work-runtime-ktx: 2.9.1 → Removed
- androidx.room:room-compiler: 2.7.2 → 2.8.4
- androidx.room:room-ktx: 2.7.2 → 2.8.4
- androidx.room:room-runtime: 2.7.2 → 2.8.4
- net.zetetic:sqlcipher-android: 4.10.0 → 4.13.0
- Samsung Health Data AAR: 1.0.0 → 1.1.0
4.0.0
New Features
Android 16 Support
The SDK now targets Android 16 (API level 36). Ensure your project's compileSdk and targetSdk are updated to 36 to
avoid compatibility warnings.
BackgroundSync Progress Updates
You can now implement a BroadcastReceiver to monitor the progress of BackgroundSync in real-time. This allows for UI updates (e.g., progress bars) during background data transmission. Check the progress updates section in the background sync documentation.
Improved Synchronization
- Current day Summary sync: Enabled summary synchronization for the current day.
- Current day Heart Rate Events sync: Get accumulated Hear Rate measurements for the current day with
rookSamsung.getTodayHeartRate()orRookSamsungObject.getTodayHeartRate(Context). - Temperature events sync with
rookSamsung.syncEvents(LocalDate, SHSyncType.Event)orRookSamsungObject.syncEvents(Context, LocalDate, SHSyncType.Event)(requiresSamsungHealthPermission.BODY_TEMPERATUREpermission). - Automatic background cleanup: A successful call to
deleteUserFromRooknow automatically halts and cancels any previously scheduled BackgroundSync tasks.
Diagnostics
Get the current SDK state during development. Read documentation.
New Authentication
The authentication flow has been redesigned to improve security and eliminate the need for embedding secret keys within your application code.
New Requirements
To initialize the SDK, you must now provide your Client UUID and a secret. The SDK will perform a server-side validation of these credentials against the package name of your application.
You must register your applicationId (package name) and its corresponding secret in the ROOK Portal before
attempting to initialize the SDK. Failure to register these credentials will cause the initialization to fail with an
SHNotAuthorizedException.
If you come from a previous version you MUST re-initialize the SDK with the new authentication flow.
Environment Management
The ROOK Portal supports independent configurations for Sandbox and Production environments. Each environment requires its own unique pair of Package Name and secret.
Breaking Changes
SDK Version Requirements
The library has increased its baseline requirements to align with lastest Samsung Health Data SDK requirements.
- Minimum Support: Updated to Android 10 (API 29). The
minSdkis now set to 29.
Exception Renaming
SHHttpRequestException: The propertiescodeanderrorhave been renamed tohttpCodeandhttpMessagerespectively.
Return Type Changes
SHCalories- basal: Changed from Double to Double?
- active: Changed from Double to Double?
Function Signatures
The following functions have updated return types:
sync(LocalDate)(Instance and Object): Now returnsSHSyncSummariesResult.sync(LocalDate, SHSyncType.Summary)(Instance and Object): Now returnsResult<SHSyncStatus>.syncEvents(LocalDate, SHSyncType.Event)(Instance and Object): Now returnsResult<SHSyncStatus>.
Migrations
| Component | Status | Migration Action |
|---|---|---|
clearUserID | Removed | Replace with deleteUserFromRook. |
Dependency updates
- Gradle: 8.6.1 → 8.9.3
- Kotlin: 1.9.24 → 2.1.21
- androidx.core:core-ktx: 1.15.0 → 1.17.0
- androidx.appcompat:appcompat: 1.7.0 → Removed
- com.google.android.material:material: 1.12.0 → 1.13.0
- com.squareup.moshi:moshi-kotlin-codegen: 1.15.1 → 1.15.2
- com.squareup.moshi:moshi: 1.15.1 → 1.15.2
- com.squareup.retrofit2:converter-moshi: 2.11.0 → 2.12.0
- androidx.room:room-compiler: 2.6.1 → 2.7.2
- androidx.room:room-ktx: 2.6.1 → 2.7.2
- androidx.room:room-runtime: 2.6.1 → 2.7.2
- net.zetetic:sqlcipher-android: 4.7.0 → 4.10.0
- Samsung Health Data AAR: 1.0.0-b2 → 1.0.0
V1 — Long-Term Support (LTS)
Rook Samsung SDK v1.1.0 remains our Long-Term Support (LTS) version. It will continue to receive critical bug fixes and security patches until September 27, 2026.
What this means
- Guaranteed long-term stability for existing integrations.
- Continued critical updates and security maintenance.
- Ideal for production environments requiring predictable and reliable support.
Maintenance releases
1.1.0
- Improved logging
- Improved nutrition calories calculation.
- Improved Heart Rate Min, Avg and Max calculation
- Improved Heart Rate granular extraction
Breaking change
The following properties types were changed from Instant to ZonedDateTime:
- SHSleepSummary
- dateTime
- sleepStartDateTime
- sleepEndDateTime
- SHPhysicalSummary
- dateTime
- SHBodySummary
- dateTime
- SHActivityEvent
- dateTime
- activityStartDateTime
- activityEndDateTime
1.0.0
- Initial release