Data Integration

Android - Health Connect Guidelines

The Sahha SDK collects health data from Android Health Connect.

Follow these guidelines to ensure your app is approved by Google.


Overview

Health Connect provides a central repository for health and fitness data on Android. With the user’s permission, apps communicate with the Health Connect store to access and share this data. Use the enableSensors method of the Sahha SDK to show a user permission dialog for your app.

Read the official Health Connect Documentation for more information.

User Privacy

Because health data may contain sensitive, personal information, apps must receive permission from the user to read data from or write data to Health Connect. They must also take steps to protect that data at all times. For more information, see Protecting user privacy .


Availability

Which mobile devices are able to use the Health Connect app?

Only mobile devices with Android 9 (API 28) or higher can use the Health Connect app. These devices must also have Google Play services installed.

Devices with Android 14 (API 34) or higher have Health Connect installed by default.


30-day read restriction

Health Connect allows your app to read records with a time or startTime for up to 30 days before your app's first successful permission request. If your app is uninstalled and then re-installed, the date is reset which marks as your new starting date as if you use it for the first time.

Example

If a user first granted read permission to your application on March 30, 2023, the earliest data your app could read back would be from February 28, 2023 onwards.

The user then deletes your app on May 10, 2023. The user decides to reinstall it on May 15, 2023 and grant read permission. The earliest date your app can now read data from is April 15, 2023.


Requesting user permission

Any time your app requests user permissions, the system displays a form with all the requested data types shown. The user can toggle individual read and share permissions on and off. To learn how to provide a great user experience when asking for permissions, see Health Connect general UI guidelines .

Using Health Connect

What if a user rejects your app's permission?

Users have full control over which health data they would like to share and which apps to share it with. Your users may choose not to share specific health data with you for a number of personal reasons. If a user perviously denied your app permission but would like to enable permission, you must guide them to the correct screen to do so.

  1. Call openAppSettings from the SDK (or open the "Health Connect" app from the Home screen) Using Health Connect
  2. Search or scroll to the name of your app Using Health Connect
  3. Choose which data types to enable / disable for your app Using Health Connect