Samsung Health Data SDK provides various operation types, allowing developers to access Samsung Health data. Available operations may vary, depending on the data type. Operations like reading data, reading associated data and aggregating data return a list of data points, representing values stored in Samsung Health, such as a list of heart rate values from a specific time range.
Each data point includes a data ID and data source information representing the app and the device, which initially measured the data.
Read data
A reading operation is a basic query to get a set of data from Samsung Health. Users can set conditions such as data types, time range, or data source.
To read data, check the following property in each data type:
readDataRequestBuilder
Aggregate data
The aggregate operation is helpful to get summarized and processed data that is frequently used. It provides an aggregated value with a simple code. Conditions including a local time filter can be set to the aggregate operation.
To use the aggregate operation, check the properties of each data type from the list below:
TOTAL of StepType
TOTAL_ACTIVE_TIME in ActivitySummaryType
LAST of ActiveTimeGoalType
MIN and MAX in HeartRateType
Read changes
Reading changes gives data change information for a given data type and conditions. It returns a change list. Each change item includes a change type as UPSERT and DELETE and a change time. In case of updated data, a data point is retrieved. For deleted data, it gives the data’s ID. This feature helps keep the app current by reading only the changes made since the last synchronization with Samsung Health.
To read changed data, check the following property in each data type:
changedDataRequestBuilder
Read associated Data
Reading associated data is useful to get multiple data types which are related to each other. For example, Samsung Health records oxygen saturation and skin temperature during the user’s sleep. This operation helps to make a simple query to get sleep data (base data) with oxygen saturation and skin temperature data (associated data).
To read associated data, check the following property in each data type:
associatedReadRequestBuilder
Insert data
An insertion operation is a basic query to write sets of data into Samsung Health. You can specify the data type, corresponding values for each field and device used to record the data. Optionally, you may assign a unique identifier, referred to as the client data ID. For more details, please refer to HealthDataPoint.clientDataId in the SDK’s documentation.
To insert data, check the following property in each data type:
`insertDataRequestBuilder
Update data
Updating data is available for the data inserted into Samsung Health by the app. To update data, obtain the desired data’s uid or clientDataId and specify the data’s relevant fields, then update the data.
To update data, check the following property in each data type:
updateDataRequestBuilder
Delete data
Data deletion from Samsung Health is available using Samsung Health Data SDK. only data that was inserted by the app using the SDK can be deleted. To build a request for data deletion, one may set conditions like the data's ID or time filters.
To delete data, check the following property in each data type:
deleteDataRequestBuilder
NoteYou may perform the inserting, updating or deleting operation on multiple data at once. If a performed operation fails for even just one of the data, then none of the data from that request will be processed. So, check for an exception to the request.
Manage Your Cookies
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
.samsungdeveloperconference.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
LinkedIn
.linkedin.com
Meta (formerly Facebook)
.samsungdeveloperconference.com
Google Inc.
.samsungdeveloperconference.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
LinkedIn
.ads.linkedin.com, .linkedin.com
Advertising Cookies
These cookies gather information about your browser habits. They remember that
you've visited our website and share this information with other organizations such
as advertisers.
Company
Domain
LinkedIn
.linkedin.com
Meta (formerly Facebook)
.samsungdeveloperconference.com
Google Inc.
.samsungdeveloperconference.com
Preferences Submitted
You have successfully updated your cookie preferences.