HealthDiary

The HealthDiary sample app enables you to learn an entire data access flow using Samsung Health Data SDK. It covers the data permission request and representative data request operations. Requests for steps, sleep, nutrition, and heart rate data are processed on a daily basis.

Open the HealthDiary app project and see the detailed code. If you build and run the HealthDiary app, the following main activity is shown.

In the main activity display, select one of the data types. To acquire a data permission allowance, a data permission popup will be shown. If all permissions are allowed, the next page will show retrieved data from Samsung Health.

Through the HealthDiary sample code, you can learn the following:

  • Aggregating total steps and steps by time
  • Reading sleep data
  • Reading and adding nutrition data
  • Reading heart rate data

To test data insertion, see the nutrition-related code. Writing nutrition data into Samsung Health requires an access code. Enter the following info in the developer mode page of Samsung Health Data SDK.

  • Client ID: com.samsung.android.health.sdk.sample.healthdiary
  • Access code: KhkudYY9

Once the access code for HealthDiary is successfully added, a new item with the package name of the HealthDiary app will be added at the bottom of the developer mode page.

Code download

HealthDiary sample app v1.0.0
(722 KB)