How to collect the Samsung Health Data from Samsung Watch

Samsung has developed an integrated ecosystem that allows the developers to read the health data. Samsung stores health data in its servers. Samsung securely stores health data on its servers, prioritizing user privacy. Through its “Become a Partner” program, users can grant consent for third-party apps to access their data.

Ways to Collect the Health Data

There are two ways to collect the health data from the Samsung devices:

  1. Use the Health Connect app.
  2. Create our own Mobile app and Watch app.

Health Connect app

According to the document at https://developer.samsung.com/health/blog/en-us/2022/12/21/accessing-samsung-health-data-through-health-connect, Samsung offers developers the capability to access health data. To accomplish this, users need to install the “Health Connect” app on their Samsung watch and mobile device. Once this app is installed, developers can retrieve data from the Health Connect app.

When the user connects Samsung Health to Health Connect, any new or updated data in Samsung Health is automatically shared with Health Connect. This bi-directional synchronization enables our applications to access Samsung Health data through the Health Connect APIs. In other words, it ensures that health data can be seamlessly accessed and utilized by developers using the Health Connect platform.

Limitations of the Health Connect app

  1. Samsung Health has supported synchronizing data with Health Connect since application version 6.22.5, released in October 2022. 
  2. The Health Connect APIs support devices using Android SDK 28 (Pie) or higher.
  3. This will work only on the Samsung devices.
  4. Old Samsung mobile and watches will not be supportable. 
  5. Reading data with Health Connect is restricted to applications running in the foreground. This restriction is in place to further strengthen user privacy. This assures users that Health Connect does not have background read access to their data, and that data is only read and accessed in the foreground.
  6. Health Connect can read data for up to 30 days prior to when any permission was first granted. However, if a user deletes your app, the permission history is lost. If the user reinstalls your app and grants permission again, your app can read data from Health Connect up to 30 days prior to that new date.

Developer Account 

We need the Play store developer account to deploy the app.

.

Devices

  1. Samsung mobile
  2. Samsung watch

Create your own Mobile & wearOS apps

To access the health data from a Samsung Watch, we can choose to develop either two separate apps or a single app with distinct modules.

Modules Types

  1. Mobile:  This app will fetch the health data from the Samsung watch via Wear app.
  2. Wear:  This app will collect the health data from the Samsung watch, and will send to the mobile app via sync.

Note: Both module’s package name and app name should be the same.

Account Requirements

To work on this we need the two different developer accounts.

  1. Play Store developer account.
  2. Samsung developer account.

Device Requirements

  1. Samsung mobile
  2. Samsung watch

Sign up to become a partner on Samsung

We need to sign up to become a partner on Samsung at http://developer.samsung.com/account. Once approved you will be sent an app ID, app secret, and a SDK. Using the SDK you can download Walks, Exercise, Fitness, Food and other body vitals like BP, Glucose etc.

Reference link: https://stackoverflow.com/questions/18073957/samsung-s4-health-app-apis?rq=4

Android

Health Platform API is an Android API that provides developers with a single interface for reading, writing, and sharing a user’s historic health, wellness, and fitness data. With the help of this we can retrieve the Google fit data from the device or the watch. (Not sure but need to test on the real devices.)

https://developer.android.com/health-and-fitness/guides/health-services/health-platform

Samsung Health SDK for Android

Samsung Health SDK for Android enables the sharing of health data between Samsung Health running on Android phones and partner apps. With the help of this sdk we can collect the data via wear app. After that we need to deploy the apps on the samsung and google play stores.

https://developer.samsung.com/health/android/overview.html

Note: If we are just targeting Samsung devices then this app will only target Samsung mobile phones that will support the wearOS or watch.

Leave a Reply

Your email address will not be published. Required fields are marked *