Android Health provides the following APIs to create health and
fitness apps across form factors: [Health Connect](https://developer.android.com/health-and-fitness/guides#health-connect) and
[Health Services on Wear OS](https://developer.android.com/health-and-fitness/guides#health-services). You can use one or both for your
app experience.

This developer center includes guidance for using both APIs, and points to
additional resources from across Android to help you build health and fitness
apps.

<br />

## Read and write on-device health and fitness data using Health Connect

[Health Connect](https://developer.android.com/guide/health-and-fitness/health-connect) is an Android
platform that allows health and fitness apps to store and share the same
on-device data, within a unified ecosystem. It also offers a single place for
users to control which apps can read and write health and fitness data.
Health Connect supports reading and writing over 50 different data types,
from cycling speed to body temperature. If you're building a new app, we
recommend you use Health Connect.

[Get Started with Health Connect](https://developer.android.com/guide/health-and-fitness/health-connect)

## Access high-quality sensor data with Health Services on Wear OS

[Health Services on Wear OS](https://developer.android.com/training/wearables/health-services)
is an API that acts as an intermediary to the various sensors and related
algorithms on Wear OS devices. The API provides apps with high-quality data
related to activity, exercise, and health, in a battery-efficient way. Health
Services is consistent across devices running Wear OS 3 or higher, meaning you
only need to write your app once, and Health Services takes care of ensuring
the app performs the same, regardless of the device.

[Get Started with Health Services](https://developer.android.com/training/wearables/health-services)

## Android Health across devices

**Health Connect** is only available on Android mobile devices. However, if you
have other data sources connected to your mobile app, such as a wearable,
you can use your mobile app to facilitate the data transfer from the wearable
to Health Connect and correspondingly from Health Connect to the wearable.
| **Note:** Health Connect is not well-suited for providing live data, but rather storing and unifying data across apps and devices.

At this time, **Health Services** is only available for Wear OS
devices running Wear OS 3 or higher. For all other devices, including phones,
you should consult the documentation for [`SensorManager`](https://developer.android.com/reference/android/hardware/SensorManager).

[Companion Device Manager](https://developer.android.com/guide/topics/connectivity/companion-device-pairing)
and [Bluetooth connectivity](https://developer.android.com/guide/topics/connectivity/bluetooth)
are additional options to connect companion devices that don't run Wear OS.

You might be familiar with the Google Fit Android API, which supports many
fitness-related actions such as reading near-time and historic data and
recording activities. The Google Fit Android API has been
[marked as deprecated](https://developers.google.com/fit/android). If your app
uses the Google Fit Android API, consult the
[migration guide](https://developer.android.com/guide/health-and-fitness/health-connect-guidelines/migrate/migration-guide)
to learn about alternatives for maintaining your app's capabilities. Many of the
actions you can perform with the Google Fit Android API can be done with Android
Health APIs. For example, you can use the
[Recording API on mobile](https://developer.android.com/health-and-fitness/guides/recording-api) instead of
the Google Fit Recording API.

To plan out which APIs to use, you should consult the following data types
guides to
understand what data you could potentially read from Health Connect and what
data you could use Health Services to read from Wear OS devices:

[Health Connect Data Types](https://developer.android.com/guide/health-and-fitness/health-connect/data-and-data-types/data-types)

[Health Services Data Types](https://developer.android.com/reference/kotlin/androidx/health/services/client/data/DataType)

The most complete multidevice experiences use both Health Services and Health Connect
to offer the most value for users.
| **Note:** In order to read a particular data type from Health Connect back to your app, your user must have at least one app on-device that is writing that particular data type. For example, if you want to use heart rate in your mobile app and your app doesn't already measure heart rate, you need to rely on another app writing heart rate values to the Health Connect datastore in order to read heart rate data back.