Google has many health products and services in its portfolio, including Health Connect. The Google Fit Android API has been deprecated and will be supported until the end of 2024, when it will be turned down. The following guidelines show you which API or platform to migrate to from each Google Fit Android 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:
Use SensorManager, FusedLocationProvider
Use Health Services
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:
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:
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:
Follow these steps to migrate from the Recording API:
Use Health Services
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:
Use Health Connect
Use Health Connect from the mobile app and not the wearable.
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.
|No replacement API available.||No replacement API available.|
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:
|Use Android Bluetooth APIs directly.||Use Android Bluetooth APIs directly.|
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 the steps outlined here.
- 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 Fit Android API, we’re aiming to turn down the API no sooner than the end of 2024. 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 Fit SDK:
- Remove code associated with the Fit Android API.
- Remove dependencies.
The timing of your deprecation of the Fit Android API should depend on your own analytics and assessments. You can maintain integration with the Fit Android API until the end of 2024.