To date Apple and Google allow developers building rich experiences with HealthKit and Google Fit APIs. The field of opportunities that companies provide to developers by opening their APIs is generous. While Google focuses more on the fitness tracking and better connectivity of all Android-powered wearables, Apple explores new opportunities in the healthcare industry.
We’ll start from some basic topics like core modules the frameworks are consists of and what are the datatypes that HealthKit and Google Fit provide. At the same time, we’ll provide the real world examples or what you can build with fitness platforms.
- Advantages of Apple HealthKit and Google Fit APIs
- Easy access and storage of sensor data
- Better interoperability
- All the basics covered
- Google Fit Platform Breakdown
- Examples of Data Types Google Fit API Provides
- Apple Health & Fitness APIs
- Examples of Data Types Apple’s HealthKit Framework Provides
Advantages of Apple HealthKit and Google Fit APIs
Easy access and storage of sensor data
Fitness and wearables are meant to go hand in hand. Many watches have a GPS, sensors, a heart rate monitor, and potentially a barometer. But without a comprehensive platform, it was hard for developers to consolidate this data.
Thanks to the power of Health API’s your app can get access to all these ways of measuring fitness activities. Such functions as read, interpret and record data from fitness devices now covered by fitness platforms.
This is one of the main problems Android developers faced in the past. Google Fit provides simple, standard way for fitness devices to connect. Back in times, in order to integrate with numerous Android gadgets, app developers were required to build their own platform to connect them all. Google Fit solves this problem by giving apps one single API to access, record and store sensor data.
In other words, Google Fit and HealthKiit are such little fitness hubs that ground all information streams on itself. As a developer, you don’t need to understand or create API for your app. You can just connect your fitness wearable to the nutrition app through Google Fit. Or you can now synchronize sleep tracking app with yoga app through HealthKit with no need to understand someone else’s code.
All the basics covered
The platforms not just consolidate data. They provide low-level sensor recording (only with the user consent) and perform hard computations for things like distance and calories. Here are some information types and computations that platforms process:
- Food Items Eaten.
- Hydration Data.
- Record Steps & Daily Step Total.
- Aggregate Daily Nutrition Data.
- Heart Beats per Minute for a Time Interval.
- Blood Pressure & Glucose Data.
- Average, Maximum, and Minimum Index for a Particular Type of Activity.
- Sleep Duration (light, deepness, REM).
By the way, this is only the fraction of all data types that you can access through APIs. There are also different Heart Rate timestamps, distances fused from user’s height and GPS, etc. You can familiarize with a full list of data types on the Google Fit developers page.
Google Fit Platform Breakdown
To start with, you should understand that Google Fit is only a part of bigger ecosystem called Google Play services, which includes Maps, Google+, and more. This is Google Play that allows your app to connect to PlayStore and contains the individual Google services and runs as a background process in the Android OS.
Google Fit itself can be divided into four big components and two minor.
- Sensors API, which gives you access to raw sensory data streams (like heart rate) from Android devices and wearable devices.
- Recording API, it does automated storage of fitness data for your using subscription. For example, you can subscribe to a data type and Google Fit will store fitness data for that data type in the background.
- History API, which provides access to the fitness history and lets you perform bulk operation like reading, inserting, and deleting from the finished history.
- Sessions API. Sessions are basically a metadata layer on top of raw fitness data that lets you store the whole computed activities like a bike ride or weightlifting.
- Goals API, a minor component that provides a way to track the goals the user has set for their health and fitness progress.
- Bluetooth Low Energy API provides access to Bluetooth Low Energy sensors in Google Fit. This API enables your app to look for available BLE devices and to store data from them in the fitness store.
Examples of Data Types Google Fit API Provides
- Total time and number of segments in a particular activity for a time interval.
- Average, maximum, and minimum heartbeats per minute for a time interval.
- Instantaneous power generated while performing an activity.
- A bounding box for the user’s location over a time interval. GPS.
- User’s nutrition intake during a time interval.
- Power generated while performing an activity.
- Jump height measures the height in inches for each jump recorded over a given period of time (Provided by Adidas’ App).
Apple Health & Fitness APIs
On the other hand, iPhone-maker is more focused on the healthcare as a whole. As it states from the naming of API, Apple is searching for new ways to drive revenue grows by expanding its presence in healthcare.
New functions introduced with HealthKit app last year makes it more like a diagnostic tool that simple a fitness tracker. Through the recent health tech acquisitions Apple has assembled the team of experts working on two problems:
- Safe transfer of health information from one hospital to another one.
- Help doctors analyze mountains of data about their patients.
From the developers’ point of view, Apple opens up a new field for grows and experimentation. There are actually three kits that cover health care needs of users.
HealthKit – A massive framework that consolidates health and fitness data of the user and allows third-party apps to access this data while maintaining the user’s privacy and control over their data.
ResearchKit – A framework released in 2015 that enables provider and medical researchers to create a study that they can conduct on a large scale using iPhones.
CareKit – This framework evolved from ResearchKit. It is an open-source framework that enables providers to build apps that can empower patients to take an active role in their care. It’s basically an upgrade that provides patient an access to their health data from ResearchKit and other sources in a handy manner.
CareKit is great for chronic and acute use cases. For example, you can supplement a mental health treatment where medication tracking is critical. Also, your app can perform assessments like depression and anxiety surveys to see user’s progress.
Another good example of CareKit and HealthKit integration is a surgery, where one of the most critical parts is the recovery post-surgery phase. You can supply patients with dynamic instructions for post-surgery recovery, that will change over time according to the patient’s progress.
Examples of Data Types Apple’s HealthKit Framework Provides
Apple names user’s data types as “constants” and grouped identifier into Type Identifiers based on the type of data samples they provide. Here’re examples of data from each group you might be interested in:
- Body Measurements – user’s body mass index, fat percentage, height, etc.
- Fitness Identifiers – a number of steps the user has taken, the distance the user has moved using a wheelchair, energy burned, etc.
- Vital Signs Identifiers – user’s heart rate, body temperature, blood pressure, respiratory rate.
- Results Identifiers – oxygen saturation, the number of times the user has fallen, or a number of puffs user has taken from inhaler.
- Nutrition Identifiers – the amount of biotin, caffeine, calcium, and other ingredients consumed.
- UV Exposure Identifier – A quantity sample type that measures the user’s exposure to UV radiation based on body temperature and lighting conditions.
- Characteristics Type Identifiers – user’s sex, blood type, date of birth, skin type, etc.
You might already notice that many data types rely on manual input, so don’t expect much magic out of Google and Apple’s Fitness APIs.
For example, you’ll get user’s blood type only if he/she indicates it manually. Although no one stops you to ask required information during onboarding. There are many use cases how to acquire user’s data, some of them we’ll cover in our next articles. But you better save your time and ask directly by contacting us!
To date, Apple’s HealthKit and Google Fit provides developers access to a broad range of metrics and data types. Also tech giant made sure that it is easy for us as a development company to create new products and fitness apps. As you may notice from examples of data types there is a vast field of opportunities which only limits your creativity!