Migration Guide

Google has many health products and services in its portfolio, including Health Connect. The Google Fit APIs have been deprecated and will be supported until June 30, 2025, when they will be turned down. The following guidelines show you which API or platform to migrate to from each Google Fit Android API.

Migrating from the Fit Android API to Health Connect API

There are 3 key steps you need to go through to migrate to the Health Connect API.

Step 1: Integrate

The first step to integrating is to add Health Connect to your app. This will include the following:

  • Integrate with Health Connect by following these getting started steps.
  • Declare data types and access mode required in the app manifest.
  • Get permission from the user to access Health Connect.
  • Read/write data according to your specific use cases or workflows.

Step 2: Migrate

We recommend keeping both your Google Fit Android API and Health Connect API integrations active while users migrate from one platform to the other. While we’ve deprecated the Google Fit Android API, we’re aiming to turn down the API no sooner than June 30, 2025. This is to give users enough time to switch to Health Connect and continue their service.

Step 3: Clean up

Follow these steps to remove the Google Fit SDK:

  1. Remove code associated with the Google Fit Android API.
  2. Remove the Google Play services dependencies.

Sensor API

The Sensor API lets you read raw sensor data in your app in real time. The Sensor API does the following:

  • Lists data sources that are available on the device and on companion devices.
  • Registers listeners to receive raw sensor data.
  • Unregisters listeners so that they no longer receive raw sensor data.

Migrate to the following APIs or platforms from the Sensor API:

Phone Wear

Use SensorManager, FusedLocationProvider

Use Health Services

  • PassiveMonitoringClient
  • MeasureClient
  • ExerciseClient

    Or use SensorManager, FusedLocationProvider

Session API

Sessions represent a time interval during which users perform a fitness activity.

The Session API lets your app create sessions in the fitness store.

Migrate to the following APIs or platforms from the Session API:

Phone Wear

Start/stop: Not applicable. The application should track the state of ongoing sessions internally.

Read/write: Use Health Connect.

Start/stop: Use Health Services (ExerciseClient)

Read/write: Use Health Connect via mobile app.

For specific workflows, we advise the following:

  • Inserting a session: Developers should use Health Connect via mobile app and either insert an ExerciseSession Record or a SleepSession Record accordingly.

Recording API

The Recording API lets your app request automated storage of sensor data in a battery-efficient manner by creating subscriptions. A subscription is associated with an Android app and consists of a fitness data type or a specific data source.

Migrate to the following APIs or platforms from the Recording API:

Phone Wear

Follow these steps to migrate from the Recording API:

  1. Implement data capture using the Recording API on mobile.
  2. Write captured data to Health Connect or your app database.

Use Health Services

  • PassiveMonitoringClient
  • ExerciseClient

See the Health Services documentation for more on the differences between the PassiveMonitoringClient and ExerciseClient.

History API

The History API lets your app perform bulk operations on the fitness store including reading, inserting, updating, and deleting historical health and wellness data.

Migrate to the following APIs or platforms from the History API:

Phone Wear

Use Health Connect

Use Health Connect from the mobile app and not the wearable.

Goals API

Goals are targets in the Google Fit app that users can set for themselves. They help motivate users to stay active every day. From within their profile, users can adjust how many steps and heart points they want to aim for each day. The Fit platform records their goals and tracks their daily activity against these using the Goals API.

Phone Wear
No replacement API available. No replacement API available.

BLE API

Your app can find available Bluetooth Low Energy (BLE) devices and insert sensor data into the Google Fit platform using the BLE API.

Migrate to the following APIs or platforms from the BLE API:

Phone Wear
Use Android Bluetooth APIs directly. Use Android Bluetooth APIs directly.