Tech

Inside HealthKit: Apple’s Answer to the Quantified You

Apple’s plan to help apps, third party devices and healthcare services collect, quantify and share your health data is ambitious and, if it works as advertised, could change the way you track and manage your well-being.

At its most fundamental level, HealthKit is a framework, which lives in Apple’s XCode programming language, for storing, retrieving, manipulating and presenting health info on apps and, perhaps, in third-party devices. It was introduced on Monday as part of the iOS 8 unveiling at the company’s World Wide Developer’s Conference (WWDC). According to the iOS Software engineers that built it for Apple, iOS, HealthKit is designed to handle simple health data entry, statistical analysis of health data and to allow applications from Health providers to sync data to personal medical records.

It’s all tall order, but one that, based on what I saw, boils down to the capture and quantification of humans' most precious data.

How do you quantify a human?

While there’s still little known about Apple’s Health App, which is ostensibly is based on HealthKit, The Apple engineers outlined in code-crunching detail just how app developers might use Apple’s HealthKit calls and routines to build new health-related apps and integrate the functionality into existing apps.

At its core, HealthKit’s framework is built upon Units and Quantities. Those unites can be discrete, unchanging objects like date of birth and gender or cumulative ones like steps, calories and blood pressure. Programmers build their apps using HealthKit to collect this data direct from people, who enter it when they open HealthKit-enabled apps, and from third-party services and devices that either have the HealthKit code written into them or are HealthKit enabled. HealthKit even has event monitoring built in, so it can observe and report on changes to the user through the HealthKit-enabled app.

HealthKit will allow programmers to collect and quantify this data, which in HealthKit is read-only and immutable, in a variety of ways. They can simply add it up (number of steps taken) or they can measure it based on date (when did you sleep and for how long). When programmers are adding these variables, they can set the start and end dates as the same for, say, a single weight reading or for, for instance, a span of a few hours or days for heart-rate measurement during exercise and rest.

The framework can also apply some nifty, on-the-fly, statistical analysis on all of this data. “Statistics are a first-class citizen in HealthKit,” noted one Apple engineer. It can look at “sum,” “maximum,” “minimum," or “average” for all data, for an object like heart rate, or maybe just a single source of heart-rate measurement. Similarly, it could parse out the steps for one measurement device and ignore or separate another.

All this HealthKit data, by the way, will reside in a HealthKit data store database that each app developer creates when they set out to use the HealthKit framework. Having that database backend is what makes all these smart queries possible, so, in the end, your Health App can surface truly interesting and valuable health information about you.

Be careful

As soon as you start talking about health-related data collection, though, the mind naturally turns to privacy. “Remember, health data is really sensitive to our users,” the engineer told developers. Even if they choose to build HealthKit into their apps, end users still need to give tacit permission to use their data and collect new health-related data on their behalf. Developers will have to request authorization for all the kinds of data they intend to collect and read and write permissions in HealthKit are on a per object type basis. In other word, gaining access to heart-rate date from one third-party device will not mean the app automatically has access to steps walked as well.

It’s clear Apple knows that health data is a sensitive business, though I did notice that Apple did not make it clear where the health data will be stored (locally or in the cloud) and if it will be encrypted.

Getting on board

Long before privacy even becomes a concern, however, application developers, third-party hardware developers and healthcare providers have to decide they actually want to work with HealthKit.

It’s pretty clear the app developers are interested. There was scarcely an empty seat in the vast conference room at Moscone Center where Apple held its first HealthKit Introductory session for developers. And you really can build live apps with HealthKit. I saw one Apple engineer build a simple one live in front of the WWDC developer audience.

We also know Apple has at least one Healthcare provider, the Mayo clinic, excited about the possibilities. Even so, the WWDC keynote lacked a live demonstration of Health App and not a single third-party hardware provider was there to demonstrate HealthKit’s data-collection capabilities in action.

Apple is also, by no means, the only company pursuing Health-related hubs, apps and development kits. Samsung, for instance, is building health-related hardware and software. Realistically, the only thing this level of interest and activity guarantees is that health-related hardware and software is unlikely to diminish any time soon. Who will win the human quantification competition, though, is anyone’s guess.

Apple WWDC 2014

People wait to get in to the Apple Worldwide Developers Conference at the Moscone West center on June 2, 2014 in San Francisco, California.

Image: Justin Sullivan/Getty Images

People wait to get in to the Apple Worldwide Developers Conference at the Moscone West center on June 2, 2014 in San Francisco, California.

Image: Justin Sullivan/Getty Images

Attendees wait in line to enter the Moscone Center during the Apple Inc. World Wide Developers Conference in San Francisco, California, U.S. on June 2, 2014.

Image: David Paul Morris/Bloomberg/Getty Images

Attendees wait in line to enter the Moscone Center during the Apple Inc. World Wide Developers Conference in San Francisco, California, U.S. on June 2, 2014.

Image: Mashable Lance Ulanoff

The crowd awaits the beginning of the Apple Worldwide Developers Conference event in San Francisco, June 2, 2014.

Image: Mashable, Lance Ulanoff

Apple CEO Tim Cook arrives to speak during the Apple Worldwide Developers Conference at the Moscone West center on June 2, 2014 in San Francisco, California. Tim Cook kicked off the annual WWDC which is typically a showcase for upcoming updates to Apple hardware and software. The conference runs through June 6.

Apple Senior Vice President of Software Engineering Craig Federighi (L) and Apple CEO Tim Cook speak during the Apple Worldwide Developers Conference at the Moscone West center on June 2, 2014 in San Francisco, California.

Image: Justin Sullivan/Getty Images

Apple Senior Vice President of Software Engineering Craig Federighi speaks during the Apple Worldwide Developers Conference at the Moscone West center on June 2, 2014 in San Francisco, California. Tim Cook kicked off the annual WWDC which is typically a showcase for upcoming updates to Apple hardware and software. The conference runs through June 6.

Apple Senior Vice President of Software Engineering Craig Federighi speaks during the Apple Worldwide Developers Conference at the Moscone West center on June 2, 2014 in San Francisco, California.

Image: Justin Sullivan/Getty Images

An apple representative speaks at the Apple Worldwide Developers Conference event in San Francisco, June 2, 2014.

Image: Mashable, Lance Ulanoff

Apple Senior Vice President of Software Engineering Craig Federighi speaks during the Apple Worldwide Developers Conference at the Moscone West center on June 2, 2014 in San Francisco, California.

Image: Justin Sullivan/Getty Images

Apple Senior Vice President of Software Engineering Craig Federighi speaks during the Apple Worldwide Developers Conference at the Moscone West center on June 2, 2014 in San Francisco, California.

Image: Justin Sullivan/Getty Images

Tim Cook, chief executive officer of Apple Inc., delivers a keynote address during the Apple World Wide Developers Conference (WWDC) in San Francisco, California, U.S. on Monday, June 2, 2014. Apple Inc. announced the new Mac operating system called "Yosemite".

Mashable
is a global, multi-platform media and entertainment company. Powered by its own proprietary technology, Mashable is the go-to source for tech, digital culture and entertainment content for its dedicated and influential audience around the globe.