Data | FoodNote
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
Prerequisites to run FoodNote are:
-
Prepare an Android device that supports Android 10 (API level 29) or above.
(Samsung and non-Samsung devices are available both.) -
Add the FoodNote app's dev access code developer mode.
- Client ID: com.samsung.android.app.foodnote
- Access code: Qeca0ZBM
-
Import FoodNote with Android Studio (or Eclipse).
-
Run FoodNote on the device.
Overview
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 |
---|---|
AndroidManifest.xml | Declaring required permissions with the <meta-data> element.
|
java/com/samsung/android/app/foodnote
|
|
AppConstants.java | Getting the meal type name. |
ChooseFoodActivity.java | Loading the food list of the FoodInfoTable class and showing them that the user can choose.
|
FoodDataHelper.java |
|
FoodInfoTable.java | Defining sample food information. |
MainActivity.java | FoodNote's main activity.
|
MealStoreActivity.java |
|