NutritionType

The data type representing nutrition data specifications that a user intakes.

Predefined instance

Using the following instance allows for obtaining heart rate data with more concise code.

Available aggregate operations

  • TOTAL_CALORIES
    : To get the total calories within the received nutrition data for a data request.

Required permission

The user's consent is required to access this data type. Check the granted permissions and request permissions if the required permission is not granted yet with:

See a code example in here.

Available requests

Data specifications

This data type includes the following information.

PropertyDescription
uid[Mandatory]
The data's unique identifier assigned by the Samsung Health.
startTime[Mandatory]
The timestamp representing the start of measurement, specified as Instant, in milliseconds.
zoneOffset[Mandatory]
The ZoneOffset for startTime and endTime.
dataSource[Mandatory]
The data's source information including the application package name and which device's ID.
CALORIES[Mandatory]
The calories of the food, in kilocalories.
TITLE[Mandatory]
The food's name.
MEAL_TYPE[Mandatory]
The type of meal eaten by the user during the day. It is set as MealType.
CALCIUMThe amount of calcium in milligrams.
CARBOHYDRATEThe amount of carbohydrate in grams.
CHOLESTEROLThe amount of cholesterol in milligrams.
DIETARY_FIBERThe amount of dietary fiber in grams.
IRONThe amount of iron in milligrams.
MONOSATURATED_FATThe amount of monounsaturated fat in grams.
POLYSATURATED_FATThe amount of polyunsaturated fat in grams.
POTASSIUMThe amount of potassium in milligrams.
PROTEINThe amount of protein in grams.
SATURATED_FATThe amount of saturated fat in grams.
SODIUMThe amount of sodium in milligrams.
SUGARThe amount of sugar or glucose in grams.
TOTAL_FATThe total amount of fat in grams.
TRANS_FATThe amount of trans fat in grams.
VITAMIN_AThe amount of vitamin A in micrograms.
VITAMIN_CThe amount of vitamin C in milligrams.

Since

1.0.0

See also

Constructors

Link copied to clipboard
constructor()

Types

Link copied to clipboard
object Companion
Link copied to clipboard

The type of meal. This type is used in NutritionType.MEAL_TYPE.

Properties

Link copied to clipboard

Retrieves a ChangedDataRequest instance to read changed nutrition data.

Link copied to clipboard

Retrieves a DeleteDataRequest instance to delete nutrition data that the application inserted into the Samsung Health.

Link copied to clipboard

Retrieves an InsertDataRequest instance to insert new nutrition data to the Samsung Health.

Link copied to clipboard

Retrieves a ReadDataRequest instance to read nutrition data.

Link copied to clipboard

Retrieves an UpdateDataRequest instance to update nutrition data that the application inserted into the Samsung Health.

Preferences Submitted

You have successfully updated your cookie preferences.