Developer functionality

The following describes the main functionalities of the Health Connect API.

CRUD operations on record and data synchronization

The platform provides standard insert, update, and delete functions for recorded data. Health Connect also includes a functionality that allows client apps to synchronize data out of Health Connect. This produces a log of data changes that indicates to the developer and user whether certain data types have been inserted or deleted by other apps.

Simple aggregation functions

The platform allows clients to apply an aggregation function over underlying data, performing the following functions:

  • Providing the average, minimum or maximum values (i.e., the minimum and maximum heart rate during an activity session).
  • Providing the sum total (i.e., the total step count within a daily interval).
  • Providing a simple count of the number of underlying measurements (e.g., the number of activity sessions in a given week).
  • Providing the total duration on supported data types (e.g. time spent in deep sleep this week or total duration of activity sessions today).

Availability checks

Health Connect is compatible with Android SDK version 28 (Pie) and higher. The SDK allows client apps to determine whether the Health Connect API is on the user’s Android device. If it isn’t, Health Connect triggers an availability check to determine whether the user’s device is compatible.

Permission checks

Health Connect requires you to request the user’s permission to read and/or write their health and fitness data on a per-app basis. It also allows you to see what permissions have already been granted or denied by the user.