[AUDIO LOGO]
DAN MACKENZIE: Hi, I'm Dan, the product
lead for Android Health.
SARA HAMILTON: And I'm Sara.
I'm an Android developer relations engineer,
and I work on wearables, health, and fitness.
DAN MACKENZIE: In this session, we'll dive into everything new
with Android Health this year.
SARA HAMILTON: Today we'll be covering
exciting new announcements for health on Android,
both for Health Connect and Health Services,
exactly how some of these changes work,
and we will highlight work from the developer community
within the Android ecosystem.
DAN MACKENZIE: But before we get into the details,
let's take a look back at where we've come from.
Our mission is to build innovative products that
improve our users' health, fitness, and wellness journeys.
Today we're enabling billions of Android users
to be healthier through better access, storage, and control
of their health data.
As a core value, users should be able to track their health
and fitness data in a seamless way.
And they should be able to control what data they share,
with whom, and when to stop sharing this data.
Whether that's choosing to track a run on a wearable or share
data about their sleep between their favorite mobile apps,
we want developers to have a simple, less fragmented way
to enable this, to create an ecosystem
of transformative health experiences.
SARA HAMILTON: The Android Health team
works on health products across both Android wearables
and phones.
Wearables generate personalized data
for a user to track their favorite workouts
and monitor their health.
But previously, to enable wearable health tracking,
developers had to work directly with low-level sensors
and set up different configurations
for different devices.
And users want to seamlessly share data from wearables
or other sources between their favorite mobile apps
to create a holistic view of their health data.
But previously, this required developers
to build API integrations with multiple individual partners
who could each have different permissions structures and data
formats.
DAN MACKENZIE: However, in the past few years,
there's been a lot of exciting progress to make this easier.
In 2021, we launched a new version
of Wear OS built jointly with Samsung
and have brought several new devices onto the platform,
including Google's own Pixel Watch.
We also launched Health Services to allow Wear OS apps to track
many health and fitness metrics such as heart rate, steps,
sleep, and more, using a power-efficient and consistent
API surface.
And last year, we launched Health Connect,
an on-device health data store that
provides APIs which enable users to store and share
data between their favorite Android apps,
including Samsung Health and Fitbit.
And this year, we've been hard at work continuing to improve
our Android Health offering.
So now on to our updates.
First, we'd like to share some exciting changes for Health
Connect.
And Sara's got a quick overview of how
we got to where we are today.
SARA HAMILTON: You may already be
familiar with Health Connect, which
is currently available in open beta on the Play Store.
Health Connect is an on-device data store
that provides APIs for storing and sharing health and fitness
data between Android apps.
It reduces fragmentation for users.
They have a single place to control data permissions,
and they can share their health and fitness
data between their favorite integrated apps.
And Health Connect reduces fragmentation for developers,
too.
It has a set of over 50 data types and a single permissions
management framework, meaning just one code base
to integrate with.
We built Health Connect in close partnership
with Fitbit and Samsung Health, so it
has been designed to work seamlessly
with both of these apps, as well as the more than 50 apps
in our developer ecosystem.
We're happy to see the adoption of Health Connect
continue to grow with many more apps coming soon.
Now back to Dan for the updates.
DAN MACKENZIE: Thanks, Sara.
Health Connect is currently available as an open beta
on the Play Store.
Today we're very excited to announce
that starting with the release of Android 14 later this year,
Health Connect will be a core part of Android
and available on all Android mobile devices,
no separate download required.
We also recognize how important it is for Health Connect
to be flexible and keep up to date with the latest
changes in the health and fitness landscape.
So we'll be delivering this through Google Play System
Updates, which allows Health Connect to be
updated frequently.
Starting with the Android 14 release,
users will be able to access Health Connect directly
from Settings on their device.
This will help users easily share
data between their favorite integrated apps,
and it gives them a single place to control
which apps have permissions to access their health data.
For developers, this means that there has never
been a better time to launch your Health Connect integration
and that users can look forward to a more seamless health
experience.
We've also been hard at work on new Health Connect features
which will be available with Android 14 release,
for example, a new exercise routine feature, which
will allow users to share GPS maps of their workouts
between apps, and improvements that
can make it easier to track reproductive and menstrual
health.
And for our existing Google Fit developers,
with Health Connect coming to the Android framework,
it's a great time to consider migrating from the Google Fit
Android APIs to Health Connect APIs.
The Health Connect API structure is
similar to Google Fit's Android API structure.
And Google Fit supports reading and writing
for most of the same data types through Health Connect.
And just as a reminder, as we announced to I/O last year,
the Google Fit Android APIs will be supported
until the end of 2024.
Check out the migration guides in our documentation
for more information about how to do this.
SARA HAMILTON: Before we get into the details of all
the things Dan mentioned, we have some Health Services
updates, too.
We've been continuing to work on Health Services,
our API surface for accessing sensor data on Wear OS devices,
to make sure that you can support more of the use cases
your users care about while still giving them
the battery life they need.
Health Services is supported on all Wear OS 3 devices,
despite each of these having different capabilities
and sensors.
Health Services provides a consistent API surface
across them all.
This means that developers can write code once and run it
anywhere.
As the algorithms in these devices continue to advance,
we've been continuing to make these new capabilities
and metrics available in Health Services to ensure
that you get the latest and greatest.
We're expanding to support even more use cases for your users.
In our latest release, we've added functionality
to allow developers to increase the batching
rate of fitness metrics.
Health Services gathers high-frequency data,
but delivers it in periodic batches when the screen is
off to save battery.
This works well for most use cases,
but some use cases require shorter batching intervals.
Starting with heart rate data, with the new batching modes,
you adjust the data delivery frequency to fit your use case.
And on supported devices, we've added a new feature
to automatically detect the number of golf shots.
The new version of Wear OS arrives later this year.
Wear OS 4 will be the most performant yet, delivering
improved battery life for the next generation of Wear OS
watches.
We will also be releasing additional Health Services
updates with this change.
We're improving our golf tracking.
Supported devices will allow apps
to detect the size of the swing, for example,
if it's a short swing, like a putt, or a full swing,
like a drive.
We developed this in collaboration
with Samsung to allow apps to build
seamless automatic tracking and scoring while on the golf
course.
Wear OS 4 also comes with some permissions changes.
We'll be including an additional permission
to differentiate accessing body sensors in the background
from the foreground.
For example, if your app tracks heart rate in the background
while the user is not actively using your app,
this new permission will apply.
This helps users stay in control of their health data
and helps you access the data you
need to create valuable experiences for them
in a power-efficient manner.
Now we will deep-dive into a few of the new features for Health
Connect and Health Services.
We will take a look at some code to implement some new features,
like exercise routes in Health Connect.
Let's say your app tracks a user's workout, like a bike
ride.
You'll likely want to create a GPS track of the route
that the user took for their ride.
If you have a Wear OS app, you can
use Health Services to gather high-frequency location
data for the user's ride.
Here's what the code would look like to configure tracking
for a biking exercise.
As you can see, we are requesting location data
and using the biking exercise type.
We can add other metrics, like heart rate and distance,
as well.
I won't go into all the details of how to build this,
but we have a Health Services exercise app code
sample which we just updated with Compose for Wear OS
that you can check out to learn more.
Once you've tracked the route data, whether it's
from a watch, like the example I just shared, or another device,
you can write this data into Health Connect.
As Dan mentioned before, the exercise routes feature
will be launching with Android 14, which
allows users to share maps of their workouts with other apps.
Users can give an app permission to write route data as part
of an exercise session, and then other apps
can give the user the option to import
route data from Health Connect.
Users always remain in control and can approve or deny
each route import.
To add this capability to your app,
first start with requesting write permissions.
You do this largely the same way you
would request other permissions in Health Connect.
Each data type, like exercises, heart rate, or steps
has a distinct read and write permission.
This gives the user full control over what they
want to share with each app.
Here's the permissions UI that Health Connect
provides to allow a user to manage these permissions.
And here's the permission you'll need to declare
to write exercise routes.
Note that you also need to declare an exercise permission,
as each route will be associated to an exercise session.
A session is each workout.
To check permissions, you first want
to build a set of all the permissions you're
interested in for both reading and writing.
Then make a request with the Permissions Launcher
including that set.
If the permissions are already granted, you can proceed.
If not, Health Connect will launch the permissions UI
that I showed earlier to the user.
To insert a route, first create your route object.
Each route is a list of locations
saved within a window of time.
Once you've created the list of locations,
build the route, passing in that list that we just created.
Here's an example of how to insert this data.
As you can see, we're tying this to an exercise session,
our bike ride.
The exercise session groups together all the related data
from that activity so that another app can easily
read it back.
What if your app wants to read an exercise route?
For other data types, you can request read permissions
in the same way as write permissions.
But for now, the read permissions
for an exercise route are slightly different
in order to ensure that users have complete control
over this data.
Instead of using the central Permissions Launcher,
your app will need to use an intent
to confirm that the user would like to give the app permission
to read in this specific route.
In the intent, you will need to pass in the session ID
to receive the serialized exercise route back.
DAN MACKENZIE: Once we have our workout reading or writing
exercise routes, we could consider
adding additional data types to improve
the insights for our users.
For instance, cycle tracking can give users rich insights
into their health, and many factors
can impact the menstrual cycle, including shifts in exercise,
sleep, and stress.
So your app could allow users to pull in this data as well.
And we've continued to improve our offering in this area.
We've added an intermenstrual bleeding data
type and permission.
We've improved the accuracy of our reproductive health enums,
and we've refined how Health Connect tracks menstruation
periods.
Remember, Health Connect data is encrypted and stored
on the user's device.
And the user has full control of which apps
they trust to share it with.
We could add this data type or any others to our app,
following a similar flow.
We have a great community of developers
in the Android Health ecosystem across both Health Services
and Health Connect.
We wanted to show how a few of the Health Connect partners
are using Health on Android to unlock exciting new experiences
for their users.
Health data is interconnected.
Sleep, nutrition, activity, reproductive health, and more
all inform one another.
Health Connect allows apps to easily incorporate
new data to give users this interconnected experiences
without building out many new API integrations.
For example, Peloton is using Health Connect
to let their users easily share their Peloton
workouts with other apps.
Before Health Connect, there was not always
an easy way for their users to share
their rides or their workouts to their favorite health app.
Now that Peloton is integrated with Health Connect,
it's really simple for their workouts
to be shared with any other health app that is integrated.
One app that has been making use of this is Oura.
Oura makes a smart ring that helps
users understand a holistic picture of their health.
Oura's personalized approach aims
to empower members to improve their daily well-being
and long-term health.
Here's how it will work.
Let's say a user does a high-intensity Peloton cycling
class.
That is then written into Health Connect.
Oura will read this workout from Health Connect,
allowing users to seamlessly have
a full view of their workout data in the Oura app.
And Oura will add this cycle ride
to the calculation of the user's readiness score
and make personalized suggestions
for their next workout.
If Oura determines that their body is tired from a cycling
class, the next day they might suggest
a lower-intensity workout, like one of the stretching
or walking workout classes in Peloton.
SARA HAMILTON: Another example is sleep tracking.
Sleep data is a core pillar of a user's overall health,
along with nutrition and exercise, which
are all intertwined.
A user might want to share this data with their other health
and fitness apps so that their sleep data can
inform recommendations around exercise and nutrition and vice
versa.
Oura's not just reading exercises from Health Connect.
They're writing sleep as well.
Oura is writing in all sleep data, like sleep stages
and sleep duration, as well as heart rate and heart rate
variability into Health Connect.
This allows users to share this valuable sleep data
from their Oura smart ring with their other favorite integrated
apps.
DAN MACKENZIE: This sleep data can
be used to generate new insights in other apps like Lifesum.
Lifesum is a nutrition app that aims
to improve users' lives through healthy eating, simplified.
Lifesum has been using Health Connect as a way
to rapidly expand their partnerships.
So they worked with Oura to add new capability
to read in sleep data from Health Connect.
Lifesum's goals for allowing their users to track sleep data
are to educate their users about how their dietary choices
impact their sleep and vice versa, and help
their users reach their health goals by giving them insights
that they can act upon.
Lifesum has added richer insights for their users
based on sleep data.
For example, using the sleep data,
Lifesum can provide insights about how
users' food intake correlates with their sleeping habits.
Sleep data can also be used by fitness apps like WebGym.
WebGym is an exercise app based in Japan.
They are reading in sleep data from Health Connect
to suggest exercise routines based
on sleep habits, which could not be done
with WebGym's tracking alone.
For example, if the user has not had quality sleep,
WebGym will recommend a lighter exercise,
like stretching, rather than aerobics during the day
and relaxing content before going
to bed via push notification.
Another example of apps working together
to unlock new capabilities with Health Connect
is continuous glucose monitoring.
Dexcom is a worldwide leader in continuous glucose monitoring,
with more than 1.7 million people
using their innovative continuous glucose
monitoring systems.
To empower users to take control of their health,
Dexcom is writing glucose data into Health Connect,
so users can choose to share their CGM data with other apps.
MyFitnessPal is a leading food and nutrition tracking app.
They built out an integration with Health Connect
last year to allow users to share nutrition
from MyFitnessPal's database of food and read in workout data
from other apps.
They've added an integration to read in glucose data
to help users understand how what they eat
impacts their glucose levels.
They will show members their blood glucose readings
on the same screen as food diary entries for the day,
allowing them to more easily draw
insights about how the foods they eat
impact their glucose levels.
Ubie is an app in Japan used to search
for related medical conditions based on symptoms
and then guide the user to appropriate care.
Ubie allows the user to pull in their glucose data
to provide better guided feedback to the user
and provide more detail about their symptoms
to health care providers.
To achieve this for their users, these apps
did not have to build out many new API integrations.
They just had to add a few more data
types to their existing Health Connect integration.
SARA HAMILTON: And apps are not just
unlocking new capabilities for their users
with the data they get from Health Connect.
They're saving developer resources as well.
For example, Withings, a company that
creates clinically validated smart health devices,
reduced 50% of their data sync code
by streamlining their health and fitness API integrations
with Health Connect.
They were able to save time, tech debt, and complexity
by migrating to Health Connect.
To recap, we have some exciting things
coming up in Android Health.
For Health Services, it is available on more devices
than ever.
And we've added API functionality
to enable new user experiences, like APIs
to get faster access to data, or automatically counting golf
shots, with more coming soon.
DAN MACKENZIE: And Health Connect
is moving out of open beta on the Play Store
and will be built directly into Settings on Android phones,
starting with Android 14.
Look out for new features that are coming with the Android 14
launch and continued updates afterwards via Google Play
System Updates.
If you would like to create a more interconnected health
experience for your users, we encourage
you to adopt Health Connect.
And if you're a web developer, make
sure you're using Health Services to get the best
battery performance and future-proofing
for all upcoming Wear OS devices.
Check out our documentation and code samples to get started.
We're hoping many more of you will join us
in bringing unique experiences to your users
with Android Health this year.
Thank you for listening.
[AUDIO LOGO]