Install Sahha SDK for Android
Set up your Android project and add the Sahha SDK.
On Android, the Sahha SDK reads health and fitness data from Health Connect , Google's unified health data layer. This guide walks you through checking your project requirements, preparing your manifest, and installing the library.
Prerequisites
Your Android project must support:
- compileSdk 36 or above
- Kotlin 1.9.24 or above
- Gradle 8.11.1 or above
- Android Gradle Plugin (AGP) 8.10 or above
Android OS support
- For Device and Activity support, Android 8.0 (API level 26) or above
- For Sleep support, Android 10.0 (API level 29) or above
- For Health Connect support, Android 9.0 (API level 28) or above
- Devices running Android 9–13 require the Health Connect app from the Play Store
- Health Connect is pre-installed on Android 14 (API level 34) and above
Set Up Android Project
The Sahha SDK requires uses-permission entries in your AndroidManifest.xml for every health sensor your app will access. Which permissions you need depends on which sensors you choose — that happens in Step 4) Enable Data Collection .
Open your manifest and add a starter set. Most apps begin with steps and sleep:
<manifest ...>
<!-- steps --> <uses-permission android:name="android.permission.health.READ_STEPS" />
<!-- sleep --> <uses-permission android:name="android.permission.health.READ_SLEEP" />
<application ...> ... </application></manifest> <manifest ...>
<!-- steps -->
<uses-permission android:name="android.permission.health.READ_STEPS" />
<!-- sleep -->
<uses-permission android:name="android.permission.health.READ_SLEEP" />
<application ...>
...
</application>
</manifest>
Where to find AndroidManifest.xml
- Native Android:
app/src/main/AndroidManifest.xml - Flutter:
android/app/src/main/AndroidManifest.xml - React Native:
android/app/src/main/AndroidManifest.xml
You will revisit this file when you choose your full set of sensors in Step 4) Enable Data Collection . The full list of sensor-to-permission mappings is documented there.
Install the Library
Add the Sahha repository and dependency to your Gradle files.
View Sahha Android SDK on GitHub
1. Add the repository
In your project's settings.gradle, make sure mavenCentral() is included:
repositories { mavenCentral()} repositories {
mavenCentral()
}
2. Add the dependency
In your app module's build.gradle, add the Sahha SDK:
dependencies { implementation 'ai.sahha.android:sahha-api:+'} dependencies {
implementation 'ai.sahha.android:sahha-api:+'
}
Import the Module
Import Sahha in any file where you use the SDK:
import sdk.sahha.android.source.* import sdk.sahha.android.source.*
Next Steps
Continue to Step 2) Configure Settings to set your environment and notification preferences.