The SDK provides the health data store to access the health data with a user’s consent. The data in the health data store can be shared with other partner apps also.
Preparing Data Access
An application needs to connect the health data store, and acquire data permission to access the data in the health data store. The following figure shows a basic flow for working with Samsung Health.
In case of connection failure, all exceptions should be handled clearly with a proper message to the user. It helps to prevent unexpected operations on your application. For detailed code, see:
HealthDataResolver helps to access the data with APIs of the following figure.
All queries except inserting data can be requested through a filter to set the target range for a query. A data query is sent asynchronously or synchronously.
Asynchronous query is used usually and you can select one of the methods for your need. See the following examples for more information.
HealthDataResolver.Filter is very useful to clear the data range for reading, updating, and aggregating health data. Multiple filters can be combined with:
The health data is stored based on the normalized unit as defined in International System of Unit (SI) in the following table.
Item
Unit
Height
cm
Weight
kg
Temperature
Celsius
Blood glucose
mmol/L
Blood pressure
mmHg
HbA1c
%
SpO2
%
Calorie
kcal
Speed
m/s
Distance
meter
Time
millisecond
Water intake
ml
Caffeine intake
mg
Data normalization enables your application to read health data without the specific unit. It means that you should be careful to unify the data units when inserting health data to the health data store. HealthDataUnit helps to convert data value between different units.
We use cookies to improve your experience on our website and to show you relevant
advertising. Manage you settings for our cookies below.
Essential Cookies
These cookies are essential as they enable you to move around the website. This
category cannot be disabled.
Company
Domain
Samsung Electronics
developer.samsung.com, .samsung.com
Analytical/Performance Cookies
These cookies collect information about how you use our website. for example which
pages you visit most often. All information these cookies collect is used to improve
how the website works.
Company
Domain
Samsung Electronics
.samsung.com
Functionality Cookies
These cookies allow our website to remember choices you make (such as your user name, language or the region your are in) and
tailor the website to provide enhanced features and content for you.
Company
Domain
Samsung Electronics
developer.samsung.com, google.account.samsung.com
Preferences Submitted
You have successfully updated your cookie preferences.