Wednesday, October 22, 2014

iOS: Health App and HealthKit Part:- 2

Hi Friends,

please check iOS: Health App and HealthKit Part:- 1 for information regarding iOS 8  Health app and it's features.
Now some information about HealthKit.

HealthKit:


By using HealthKit in your applications which contains Health and fitness information, can share informations with inbuilt Health app.

User can share his medical information from the Health app.For example you can allow the data from your weight tracking app to be automatically shared with your doctor.for that you have to choose which data to be shared with which person and you can turn off this sharing any time.

You can read data from Health app and write it to any other app. You can share your health information to Health application by any other applications which uses HealthKit. 

HealthKit also works with fitness and health related devices.The HealthKit data is not saved to iCloud or synced across multiple devices.The data is only kept locally in the user's device.

Benefits: 

HealthKit makes easier to share data between apps. developers  do not need to write code for each app.They can begin sharing automatically through healthKit store with HealthKit apps.

Apps can access wider range of data which gives each app a complete view of the user's health and fitness requirements.

Separating data collection, data processing and socialization:- For example a group of friends could participate in a daily cycling challenge.Each can use his hardware device or any tracking app, but t hey could all still use the same social app for the challenge.

HealthKit's Design:

All objects in the HealthKit store are subclasses of the HKObject class.Each object has the following properties:

  •  UUID:- It is a unique identifier for that particular entry.
  • Source:-  The source of the data. The source can be a device that directly saves data into HealthKit, or an app. HealthKit automatically sets each object’s source when the object is saved to the HealthKit store. This property is available only on objects retrieved from the store.
  • Metadata:-  A dictionary containing additional information about the entry. 
All objects in the HealthKit store are subclasses of the HKObject class.Each object has the following properties:

HealthKit objects can be divided into two groups: - 1) Characteristics and 2) Samples

Characteristics objects represent data that can't change. like birthdate,  blood type, biological sex.Your app can's save characteristic data.User must enter or modify using Health App.

Samples objects are subclasses of HKSample class and they have following properties. 

  • Type:-  The sample type. Eg, this could include a sleep analysis sample, a height sample, or a step count sample.
  • Start date:- The starting time for the sample.
  • End date:- The ending time for the sample. If the sample represents a single point in time, the end time should equal the start time. If the sample represents data collected over a time interval, the end time should occur after the start time.
Samples can further partitioned into:
       
  • Category samples:- There is only one type of category sample, sleep analysis. 
  • Quantity samples:-  These samples represent data that can be stored as numeric values. These include the user’s height and weight, as well as other data such as the number of steps taken, the user’s temperature, and their pulse rate. 
  • Correlations:- These samples represent composite data—data that contains one or more samples. In iOS 8.0, HealthKit uses correlations to represent food and blood pressure. You should always use a correlation when creating food or blood pressure data. 
  • Workouts:-  Workouts represent some sort of physical activity, like running, swimming, or even play. Workouts often have typeduration,distance, and energy burned properties. 


Please check HealthKit demo in iOS: Health App and HealthKit Part:- 3 which will show you how to create a HealthKit application, how to perform read-write operations with it.


1 comment:

  1. This comment has been removed by a blog administrator.

    ReplyDelete