For the complete documentation index, see llms.txt. This page is also available as Markdown.

Android

The Thryve Android SDK is the fastest way to implement Thryve's product into your Android application and is required to allow users to connect Health Connect and Samsung Health as a data source. The Thryve iOS SDK is available via the Maven repository and frameworks.

Integrate using Thryve Repository Dependencies

Thryve provides a private, protected repository supporting the Maven repository format to retrieve the Thryve SDK build artifacts. To configure a Gradle project to resolve dependencies declared in build.gradle file, the Thryve repository has to be declared as shown in the root and app build.gradle files.

The Root build.gradle file

allprojects {
    repositories {
        ... 
        maven {         
            url = uri("https://git.thryve.de/api/v4/projects/12/packages/maven")
            credentials {
                    username = thryveUsername
                    password = thryvePassword
            }
        }
        ...
    }
}

Your username and password are provided in onboarding when signing up with Thryve. It is recommended to store credentials in your project’s local.properties or the user-global Gradle properties gradle.properties

The App build.gradle file

Add dependencies to the app build.gradle after adding the repository

You must use api instead of implementation to make the Thryve SDK and it's modules work correctly

Note the change in name of the package. The versions preceding 5.0.0 used com.thryve.connector . Use the appropriate package when upgrading to or downgrading from 5.x

Integrate using Thryve .aar Libraries

The Thryve Android SDK module is available as a standard Android Archive (aar). You can download the framework files here:

The .aar libraries can be downloaded from here
Module Name
Download Version

Core SDK Module

Commons Module

Health Connect Module

Samsung Health Module

Observability Module

ShenAI module

Android Sample Code

Integrating AAR Libraries into Your Application

  1. Add AAR File:

    1. Place the .aar file in a project directory, such as libs.

  2. Update build.gradle:

    • Add implementation files('libs/.aar').

  3. Enable Kotlin Support:

  4. Add Android Support Libraries:

    • Integrate the Android AppCompat-Library.

  5. Set Java Compatibility:

    • Ensure target and source compatibility for Java 1.8.

  6. Set Kotlin JVM Target:

    • Use Kotlin JVM target version 1.8.

Ensure you include the necessary dependencies for the Thryve SDK and verify that they are all compatible versions.

Configure dependency versions

Keeping your dependency versions aligned with the supported versions of the Thryve Android SDK is crucial for ensuring compatibility and maintaining the stability of your application.

Outdated or mismatched versions can lead to integration issues, such as runtime errors or unexpected behavior, which may hinder app performance and user experience.

When updating Thryve SDK versions, always refer to the release changelog for documented dependency version updates.

Custom WorkManager configuration

Thryve Android SDK relies on Android WorkManager for scheduled background task. To provide a custom implementation and rules for background tasks and overwrite Thryve SDK defaulty, implement Configuration.Provider and use WorkManagerInitializer in your Application class. See the Kotlin code example below for guidance. The code snippet changes the minimum logging level for your app, but the implementation can be further customized to your apps needs.

Thryve Android SDK uses WorkManager for background data synchronization for HealthConnect and Samsung Health.

Health Connect project configuration

To integrate Health Connect with your Android app, utilize the ThryveHealthConnect module from the Thryve Android SDK. This module enables users to connect with Health Connect on their smartphones and allows your app to retrieve evaluated and aggregated data from various sources linked to Health Connect. You can integrate it by using Thryve Maven Repository Dependency or AAR Libraries and updating your app's build.gradle file accordingly.

Declare Health Connect permissions

To utilize Health Connect, your application must declare all necessary permissions and provide a privacy policy activity for handling the ACTION_SHOW_PERMISSIONS_RATIONALE intent within the AndroidManifest. Pay attention to the differences in declarations for Android 14 versus older versions.

Ensure that the declared policies align with the data types set in ThryveHealthConnectConfig. Also, remember to declare permissions for background sync and health data history when enabling these features.

Samsung Health project configuration

You must suppress warnings after adding the ThryveSamsungHealth module, include -dontwarn com.samsung.** in your proguard-rules file.

Last updated