Ways to Use HealthKit and Google Fit in Health and Fitness Apps
Leading a healthy life is a modern and very popular trend increasing the demand for medical and fitness tracking apps. All such applications are designed to collect and analyze information about various users' activities - and, of course, the process would be much more convenient if there is one common storage platform. Previously, this task was difficult to implement, but now, thanks to the HealthKit and Google Fit frameworks, it's much easier to achieve the desired goal. And you can offer your users exactly what they want to have - an excellent mobile solution that allows processing their fitness data in one single place.
World-famous manufacturers of medical devices and software have already appreciated all the benefits of using Google Fit & HealthKit. For example, Cedric Hutchings, CEO of Withings, believes that HealthKit has provided wonderful opportunities to create useful health and fitness apps without threatening Withings business activity. And Adam Lin, president of iHealth, claims that HealthKit and Google Fit are going to completely change the healthcare industry, and for the better.
It remains to be seen whether these frameworks are suitable for your specific goals. We hope that our article will help to figure out this issue.
Why do health and fitness apps need HealthKit and Google Fit?
Previously, before Apple HealthKit started its journey (and soon Google followed suit with its Google Fit), users had to manage their fitness data in several gym trainer apps and web tools. And although some popular healthcare platforms (the same Fitbit) tried to find the best solution to this problem, the result was less than wonderful.
Now all this is in the past, and users can easily track their lifestyle and store health and fitness data in one single place. No doubt, such approach improves the user experience and increases the desire to buy fitness activity trackers and healthcare devices. Well, and one more important bonus: thanks to these frameworks, the app development is simplified and, consequently, the price for this service is reduced. And since you are thinking about creating fitness apps for Android or iPhone, that is good news, isn’t it?
But let's go deep into the issue.
HealthKit is, actually, a toolkit that helps developers create activity tracker apps synchronized with the standard Health application (a default program for modern iOS devices) and all kinds of medical devices and software aimed to collect data on the user fitness activity (as well as his or her health situation and so on).
The Google Fit platform is similar to HealthKit from Apple and designed to monitor the physical activity and health of Android users. With the help of wearable devices or sensors built into smartphones, the service automatically fixes when the person walks, runs or rides a bicycle.
Medical and fitness tracking apps can, with the user consent, access all such data in Google Fit, including information collected by Google services and other applications.
Benefits of HealthKit and Google Fit for users and health tracker app developers:
- HealthKit and Google Fit store health and fitness data from different sources, which simplifies the shared use of various gym trainer apps. It’s a good thing because…
- Developers should not download APIs and write custom code for sharing with each application. Different health and fitness apps can exchange data with each other without using complicated integration solutions.
- Users do not have to manually establish connections between their applications or import and export their data.
- There is an opportunity to expand the functionality of fitness apps for iPhone and Android by using extra data about the health and physical activity of the user (thanks to the shared data store of the Health Apple program and Google Fit app).
We see now what the essence of HealthKit and Google Fit is, why they are needed, and how they resemble each other. But what is the difference between them (besides the obvious one, namely - they work on different platforms)?
What differences between HealthKit and Google Fit
Let's see how HealthKit and Google Fit interact with health tracker applications and process fitness data. Also, we’re going to clarify other important nuances.
In general, Apple is more thorough about health issues, and Google focuses on standard fitness indicators. In addition, Apple offers a more comprehensive, detailed approach to analyzing data, and Google provides an easier and more flexible set of tools.
It should be noted that Apple official list of data is rather larger than that of Google. Want more specifics? Welcome!
The application "Health" collects data on the following indicators of the way of user's living:
- Activity. These fitness data characterize the physical activity of the user: the steps taken are being combined with information obtained from other activity tracker apps and allow an objective result.
- Mindfulness. In this case, the Health application collects all the data and shows how much time the user has devoted to a mindfulness practice.
- Sleep. HealthKit also stores user sleep data. Information is being received from several sources (the iPhone itself with its "Sleep Mode" and third-party fitness gadgets and accessories).
- Nutrition. Apple suggests combining data about the diet in one shared store: the number of calories consumed, for example. In the same store, there will be information from third-party food control applications and popular healthcare platforms.
- Other important data. The Health app allows users to store health and fitness data relating to other life indicators (heart, analysis, reproductive health, etc.)
All data is being encrypted and backed up in the iCloud repository.
Google Fit collects data of the following types:
- Physical activity (number of steps passed, the speed of running or riding a bicycle, etc.)
- Location. This information allows Google Fit to determine the distance the user has walked, run or ridden a bicycle.
- Drinking mode and nutrition. Google Fit gets this data from connected medical and fitness tracking apps.
- Information from sensors on the body (for example, about the pulse and weight).
Fitness apps for Android that interact with Google Fit can use and share data in one of the following ways:
- Sharing when fitness data is available to all connected health and fitness apps.
- Isolated storage when a certain application blocks access to its data in Google Fit app.
All data is being stored in the cloud storage.
Obviously, it's easier for people to perceive information visually, and therefore UI/UX always plays a major role. So, both the Health program from Apple and Google Fit app made their best to create beautiful interfaces.
Usually, Apple offers a fairly convenient and simple interface for its default applications, but Health is the exceptions to this rule. However, such impression is deceptive, and, in fact, this app is well thought out and structured. Among other things, it provides the user with the ability to compare data without activating multiple screens at once.
Users can view the information they need on one single screen, pursuant to the specified parameters: for example, within a certain time interval. Besides, the system prompts which devices and fitness apps for iPhone can interact with HealthKit.
The design of the Google Fit app interface is quite intuitive and clear, but it is not perfect. Among other things, it forces the user to constantly swipe the screens to get those or other health or fitness data. Agree, this is not too user-friendly.
In general, the interface displays (in a rather simple way) the chronology of classes, goals. And a customizable widget easily transfers this information to the desktop of the smartphone. Google Fit also uses graphics and cards to make the application work even clearer.
Okay, but what are the limitations of HealthKit?
- The use of HealthKit is allowed only for fitness apps for iPhone (we mean if the HealthKit API provides their main functionality). You can not display health information if your application does not in any way affect the fitness activity or another aspect of the user's lifestyle. Or clearly explain to the user what information and why you are collecting - that is, why you need it.
- The received information about the physical activity of the user cannot be used for advertising. Yes, the idea to promote your health tracker app through Apple's famous product is very tempting, but not feasible. And it’s kind of disappointing to find that HealthKit reserves the right to earn on ads. But, as they say, “those who pay the piper call the tune”.
- The activity tracker app can share HealthKit information only if the user permits it. Yes, this is an obvious rule, but it can not be ignored. That’s why we should have mentioned such a restriction.
- You can not complement your user interface with any pictures related to the Health app from Apple (icons, screenshots, etc.). And you should not use the term "HealthKit" either. After all, HealthKit is a developer term, and it stands for a technical platform for accessing data stored in the Health application. And everything else has nothing to do with it!
- With the user's consent, you can use his or her HealthKit data for medical research (together with a third party). It is becoming quite a popular and promising trend, perhaps, you, too, want to participate in this initiative.
- Well, finally, it's important to clearly explain to the user how you and your gym trainer app are going to use his HealthKit data. Misunderstanding contributes to suspicion, and this is not good, is it?
Unlike Apple, Google does not make such a huge statement about the data stored in Google Fit. However, its advertising policy limits the use of "sensory data" in marketing activities (especially when it comes to medical records).
In fact, Google puts requirements similar to HealthKit:
- You can take advantage of API only for your own use, it's not a basis for building an API Client of the same type for third parties. Such an act can be regarded as a kind of fraud.
- Be sure to ask the user for permission to take advantage of his Google Fit app data. Again, an obvious but reasonable limitation.
- Unlike HealthKit, Google Fit does not oblige you to use its data only to create fitness apps for Android. However, you can not in any way promote the development of the online virtual casino (or gambling of the other sort) or use it for “ill advertising”.
- Don’t use the provided API to create any health tracker apps that can potentially cause damage to the user. Of course, it is beyond your conscious ability to control everything, but if you have doubts about the unsafe use of the application, better give up your idea.
Other details of the prohibitions of using API can be found here.
Example of health and fitness apps
If you want to create a successful activity tracker app, you should look at your potential competitors. And we are ready to give a few examples of popular healthcare platforms.
Of course, far-sighted applications provide support for both platforms; however, we‘ll consider the most popular services for Apple and Google separately.
- MyFitnessPal is a well-known application for monitoring calories consumed and the nutritional value of food. The user manually enters everything that he has eaten, and HealthKit allows tracking this information in one place.
- Thanks to Strava, users can track their sports activity, and the data can be conveniently viewed in the Health application.
- CARROT Fit gives users the opportunity to enter information about their workouts and scolds (yeah, it scolds!) when skipping sports activities. CARROT Fit integrates with HealthKit and takes the data placed by other gym trainer apps. In addition, the service comments on user achievements.
- Noom is a "personal dietician" aimed at helping to reduce the number of bad habits and increase the number of good ones, those which contribute to a healthy process of losing weight. Noom does not have "own" gadgets but it can integrate with Google Fit too.
- Runtastic offers a full range of applications for tracking lifestyle and physical activity. Runtastic takes the statistics from other health and fitness apps and sends its data, so it's no surprise that it readily integrates with Google Fit.
- Mi Fit is an application for Xiaomi mi band, a cheap fitness activity tracker with a wide range of features. The service data can be transferred to Google Fit.
Monitoring your competitors is a useful practice that allows correcting your own marketing strategy on time. However, before you compete with anyone, it is useful to create your own product - a competitive health tracker app.
How to use HealthKit and Google Fit in your app
And now we've come to grips with the core question of the issue: how to create the most accurate fitness tracker apps with the help of HealthKit and Google Fit? Of course, we'll not go into all the details, we'll tell only the very essence.
As you now understand, the HealthKit service provides a technical platform, a repository that fitness apps for iPhone & Apple Watch can use to share health and fitness data.
You do not need to collect such data on your own and look for ways to store this information. Also, you do not need to build analytical infographics based on the data obtained - HealthKit will do everything for you. And you can devote your time and effort to more pressing issues and thereby improve the user experience in another respect.
What is the HealthKit framework?
HealthKit itself is a hierarchy of immutable classes inherited from the abstract HKObject class. In fact, the HealthKit framework controls and structures the data types so that any fitness app can easily figure out the best way to use them. Developers do not have the right to create custom data types and units, instead, they should take advantage of those that HealthKit offers.
As we’ve said earlier, there are two types of the data objects: characteristics that do not change with time, and samples available for adding new data.
All these objects, units, and classes help structure the data so that third-party health and fitness apps can work with the HealthKit repository and interact with each other effectively. And developers no longer need to look for ways to establish such interaction.
Need more information on the matter? Then, we suggest that you study the documentation. Although it is much wiser to hire a developer who will help you in creating medical and fitness tracking apps.
GoogleFit is a fairly small and well-structured platform with clear documentation, and this platform allows getting healthcare data from various sources such as sensors in phones, smart clocks, fitness bracelets, etc. GoogleFit stores the health and fitness data in the cloud storage, and fitness apps for Android can read this information.
Integrate your activity tracker app with the Google Fitness API (the native API for Android or the REST API for building a web client) and enjoy the result. The Google Fit app will assume most of the work.
Other ways to collect data on user activity
Of course, HealthKit is not the only options to get data about user activity (when it comes to iOS platform), neither is Google Fit for Android. For example, Withings Health Mate takes advantage of Bluetooth or Wifi to receive information obtained by using the Withings Smart Body Analyzer or another device of this brand. Naturally, this approach does not allow synchronizing the work of several health tracker apps, which is less convenient for the user and reduces the capabilities of the mobile service itself.
We, too, faced the need to receive data without the help of APIs that Apple or Google provide. In particular, this need arose when we were working on the application that accesses third-party fitness activity trackers via the API, requests user activity data, and credits them with bonuses, so-called "Points". In fact, our application simulates a fitness tracker.
We should have integrated a few most accurate fitness trackers and popular healthcare platforms such as iHealth, Fitbit, Jawbone, Garmin, and Moves to get all possible data about the user's activities: how much he walked, ran, cycled, slept, etc. for the last year. Further, these data had to be processed by a special formula which the client provided us with. The formula proved to be ineffective and led to inaccurate results, and our team worked really hard to improve it. We achieved what we wanted (or, rather, what our client wanted), but the task was not an easy one. Of course, HealthKit and Google Fit would have greatly simplified our work.
A couple of tips for the last
These few tips will help you create health and fitness apps able to lead to the best user experience:
- Request access to users data only if you have a reasonable excuse. If the gym trainer app requests access to information that has nothing to do with the physical activity, users are less likely to trust this application with their personal data.
- Give users a chance to understand how their health data will be used. For example, when a user fills a profile in a weight loss app, it is reasonable to ask for the access to the weight information being stored in the Health application.
- Take advantage of the system user interface when requesting the personal data. This is exactly what the user expects, and one should not disappoint him. By the way, if the user wants to stop sharing data with your activity tracker app, he makes this change in Settings of his smartphone. There is no need to include such a feature when building your app UI.
So, if you need to develop fitness apps for Android or iPhone and you want to achieve your goal as quickly as possible (and at no extra cost), do not neglect the help that Apple and Google so generously offer. Be sure to follow all the conditions of confidentiality and try to provide the best user experience.
Of course, you will need the assistance of developers, and we’ll be glad to become your contractors. Our team has successfully been working with health and fitness apps, which means that we have both theoretical and practical experience. We know how to create an application that will work without errors and effectively.
Looking forward to communicating with you!