Get started

Stay organized with collections Save and categorize content based on your preferences.

Refer to the following resources before you begin installation of Health Connect.


  • Client SDK (available on Jetpack). Include this SDK in your application to use the Health Connect API.
  • Health Connect APK (available on Play Store). Install the APK from Play Store. It will handle all requests sent by your application using the Health Connect SDK.
  • API reference. See the Jetpack reference for the Health Connect API.
  • Github code samples (Optional). See the Github code sample repository to help you get started.

Follow these quick and simple steps to integrate with Health Connect:

Step 1: Add dependencies

First, make sure you do the following:

Add a dependency on the Health Connect SDK in your module’s build.gradle file:

dependencies {
  implementation ''

Find the latest versions on release

Install the Health Connect APK to your device:

First, opt-in to the Health Connect open beta testing program here. The open beta link also shows you how to download the Health Connect app. Once you opt-in, install the Health Connect APK on your device.

Step 2: Modify AndroidManifest.xml

Declare the below Activity in your AndroidManifest.xml to handle intent that will explain your app's use of permissions.

<application …>
    <activity name=".PermissionsRationaleActivity" exported="true">
            <action android:name=""/>
        <meta-data android:name="health_permissions"
                android:resource="@array/health_permissions" />

The app needs to handle this intent and display a privacy policy explaining how the user's data will be used and handled. This intent is sent to the app when the user clicks on the "privacy policy" link in the Health Connect permissions dialog.

Step 3: Get Health Connect client

HealthConnectClient is an entry point to the Health Connect API.

Here’s a step-by-step description of the process of connecting with Health Connect:

  1. Update AndroidManifest.xml.

    // Add this to AndroidManifest.xml
    <!-- To check whether healthcore apk is installed or not -->
        <package android:name="" />
  2. In the MainActivity, check if Health Connect is installed. If it is, obtain a HealthConnectClient instance.

    if (HealthConnectClient.isAvailable(context)) {
      // Health Connect is available and installed.
      val healthConnectClient = HealthConnectClient.getOrCreate(context)
    } else {
      // ...
  3. The client app must then request permission from the user. The user can grant or deny access to the client app at any point.

HealthConnectClient automatically manages its connection to the underlying storage layer and handles all IPC and serialization of outcoming requests and incoming responses.

Step 4: Declare and request permissions

Declare the permissions your app will use. Create an array resource in res/values/health_permissions.xml. Note that you will need to add a line for every permission your app will use:

  <array name="health_permissions">

To start the request permissions dialogue within your application, first build a set of permissions for required data types. Make sure that the permissions in the set are also declared in res/values/health_permissions.xml.

// build a set of permissions for required data types

Then, request permissions. Check if permissions have already been granted before launching the permissions request.

// Create the permissions launcher.
val requestPermissionActivityContract = healthConnectClient.permissionController.createRequestPermissionActivityContract()

val requestPermissions =
 registerForActivityResult(requestPermissionActivityContract) { granted ->
   if (granted.containsAll(PERMISSIONS)) {
     // Permissions successfully granted
   } else {
     // Lack of required permissions

fun checkPermissionsAndRun(client: HealthConnectClient) {
 lifecycleScope.launch {
   val granted = client.permissionController.getGrantedPermissions(PERMISSIONS)
   if (granted.containsAll(PERMISSIONS)) {
     // Permissions already granted
   } else {

At this point, you can begin performing CRUD operations!