Data | FoodNote

FoodNote sample download | Apr 11, 2019
(Nov 3, 2020)

The SDK's Health Data provides a FoodNote sample application to show how to manage nutrition data with Samsung Health after the permission request.


Prerequisites to run FoodNote are:

  • Prepare an Android device that supports Android 6.0 Marshmallow (API level 23) or above.
    (Samsung and non-Samsung devices are available both.)

  • Add the FoodNote app's dev access code developer mode.

    • Client ID:
    • Access code: Qeca0ZBM
  • Import FoodNote with Android Studio (or Eclipse).

  • Run FoodNote on the device.


FoodNote demonstrates how to use Health Data's APIs for checking the selected day's food intake with HealthConstants.Nutrition including permission request.

Especially, the health data store connection and exception handling would be helpful to your application to prepare unexpected error.

FoodNote's sources and resources are:

Source / Resource Description

Declaring required permissions with the <meta-data> element.


Getting the meal type name.

Loading the food list of the FoodInfoTable class and showing them that the user can choose.

  • Inserting nutrition data.
  • Deleting nutrition data.
  • Reading nutrition data of the selected day and the meal type.

Defining sample food information.

FoodNote's main activity.
  • Connecting to the health data store and handling exceptions through ConnectionListener.
  • Checking permission for HealthConstants.Nutrition and requesting permission if required.
  • Creating an option menu for setting permission.
  • Showing the selected day's calorie intake.
  • Adding an observer to get notification for the calorie change.

  • Showing a list of food intake items for the selected meal that is chosen on MainActivity.
  • Deleting a food intake item in the list.