Read Food Items Eaten

Your app can get a list of food items eaten within a specified time frame by creating a data read request and querying for DataType.TYPE_NUTRITION, as shown in the following example:

DataReadRequest readRequest = new DataReadRequest.Builder()
    .read(DataType.TYPE_NUTRITION)
    .setTimeRange(<start time>, <end time>, TimeUnit.MILLISECONDS)
    .build();

For more information about reading data, see Work with the Fitness History.

Send feedback about...