Data | FoodNote

The SDK’s Health Data provides a 'FoodNote' sample application to show how to manage food intake data with Samsung Health including the permission request. Check the sample application by importing its project with Android Studio (or Eclipse).


Prerequisites to run FoodNote are:

  • Prepare an Android device that supports Android 4.4KitKat (API level 19) or above.
    (Samsung and non-Samsung devices are available both).

  • Install the latest Samsung Health.

  • Turn on the developer mode.

  • 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 calorie intake with HealthConstants.FoodIntake and HealthConstants.FoodInfo including permission request.

Figure: FoodNote sample app

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

Table 1 describes source and resource files of FoodNote.

Source / Resource Description
AndroidManifest.xml Declaring required permissions with the <meta-data> element.
src/com/samsung/android/foodnote Getting the meal type name. Loading the food list of the FoodInfoTable class and showing them that the user can choose.
  • Inserting food intake data.
  • Deleting food intake data.
  • Reading food intake 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.FoodInfo and HealthConstants.FoodIntake, 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 calories 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.
Table: FoodNote’s source description