Introduction
programming guide samsung health sdk for android helps samsung health's partners to share health data safely and to create useful health applications samsung health has a health data store where its data can be shared with other partner apps after the user's consent it supports android devices with marshmallow 6 0 including non-samsung devices refer to the following table terms for samsung health sdk for android term description health data framework it provides useful features to handle the user's health data it is included in samsung health and its interface is provided with samsung health sdk for android an app that uses the sdk works with samsung health samsung health an application that helps monitor the user's activities and helps the users to have a healthier life through monitoring walking steps, exercise, heart rate, and etc it can be downloaded from the app market like google play or galaxy apps the term is italicized to be easily distinguished health data framework the health data framework of samsung health sdk for android has the following features health data store handling the connection to samsung health inserting, reading, updating, or deleting health data storing data based on unified units see api reference's descriptions for each data type health data type platform-defined and custom data type privacy granting permission based on the user's consent to read or write the specific data type architecture the sdk's health data framework is designed to provide safe access of its data and to have a seamless health service to the user the following figure shows the health data framework's architecture health data framework the health data framework is included in samsung health applications can access the user's data that are stored in samsung health through the sdk it keeps the user's health data safely health data from various source devices having pedometer, accelerator, or heart rate sensors are inserted to the health data framework with the unified data unit the data can be read by the sdk updating or deleting data is available if the app inserted the data the figure above shows the class and interface relationships in health data detailed descriptions for each class and interface are in the api reference healthdatastore it handles the connection to the data storage of the device it receives its connection result with healthdatastore connectionlistener most requests require the connection to the health data store healthdataresolver the health data framework provides classes and interfaces to insert, read, update, or delete the data healthdataresolver is a central class to handle the health data it sends a data request with related request interfaces the query result can be received immediately with healthdataholder baseresult, healthdataresolver readresult or healthdataresolver aggregateresult or it can be received asynchronously with healthresultholder resultlistener see health data store for more information application developers can use platform-defined data types that samsung health sdk for android provides see health data type for more information especially healthconstants common, the base interface of predefined data types, contains the following mandatory properties for health data unique id of health data created and updated time of health data application package name device that provides health data the health data can be accessed with the user's consent the following figure shows the relationship between classes and interfaces related to healthpermissionmanager it requests permissions to the user with healthpermissionmanager permissionkey to read or write for the specific health data type the permission result can be received synchronous or asynchronously see privacy for more information the sdk's health data library provides the following package com samsung android sdk healthdata main interfaces and classes in the library are described in the following table see the api reference for details interface / class description healthconnectionerrorresult this class handles errors for connection failure to the health data store healthconstants this class defines constants of health data and contains interfaces for various kinds such as the step count or exercise healthdata this class is an object for a health data type, e g the blood pressure or weight quantitative and qualitative values can be defined for the specific health data type based on its data structure definition it is used to manage health data with healthdataresolver healthdataobserver this class defines an observer to handle health data changes healthdataresolver this class accesses health data to insert, read, update, and delete with the filter and aggregate functions healthdatastore this class handles the connection to the data store in the device healthdataunit this class provides unified units for the health data store healthdatautil this class provides useful utility apis healthdevice this class contains detailed device information that provides health data healthdevicemanager this class manages devices related health data healthpermissionmanager this class requests permission to read or write health data for the specific health data type healthresultholder this interface represents the result of invoking method healthuserprofile this class provides the user information