See the on GitHub for example fitness apps | This API is not intended for background capture or workout tracking |
---|---|
Note: Health Services is available on Wear OS API level 30 | A milestone is configured with both an initial trigger amount and a period amount, so it will trigger once when the initial condition is met, and again each time the period amount is achieved |
Health Services concepts Keep the following concepts in mind when developing with Health Services.
15The trigger type determines whether the app is notified only on the next occurrence of the event with EventType | While an exercise is in progress, Health Services can collect metrics on selected DataTypes and report back to the app that is managing the exercise |
---|---|
For example, to set a milestone every time the user runs 1 kilometer, use 1km as the initial threshold and 1km as the period amount | Your app can also receive rapid data updates through this API, as long as the exercise belongs to your app |
Conserve battery by using sensor configurations from Health Services that are optimized for power efficiency.
21Take advantage of powerful algorithms running natively on the platform | |
---|---|
An event is triggered when that data type meets the specified condition | All of these allow developers to focus on developing unique features and user experiences, while relying on the platform to provide robust and consistent metrics in a power-efficient manner |
Health Services automatically configure all fitness and health related sensors appropriately for the use-case, collect sensor data, and compute metrics like heart rate, distance, calories, elevation, floors, speed, pace, and more.
9