Previously, the Health package did not support writing this to this metadata field when writing data, and in many cases you could not query or filter by the type when reading data (especially on Android).
Breaking changes
Introduce a new RecordingMethod enum, containing the 4 values that Health Connect defines.
Remove isManualEntry from HealthDataPoint in favor of recordingMethod, of which the value is an enum RecordingMethod
Remove includeManualEntry (previously a boolean) in favor of recordingMethodsToFilter, which is a list of RecordingMethod. This change affects the following functions for querying:
getHealthDataFromTypes
getHealthIntervalDataFromTypes
Note: getHealthAggregateDataFromTypes is unaffected.
When writing data you can now specify the recordingMethod to write to HealthKit and Health Connect stores, and when querying the data again it will be included in the metadata. The default value is RecordingMethod.automatic. This change affects:
writeHealthData
writeWorkoutData
writeMealData
writeBloodPressure
writeBloodOxygen
writeMenstruationFlow
Other improvements
In the example app, you can now filter data by recording method when calling "Fetch data" and "Fetch step data"
Introduction
Google Health Connect and Apple HealthKit both provide ways to distinguish samples collected "automatically" and manually entered data by the user.
Problem
Previously, the Health package did not support writing this to this metadata field when writing data, and in many cases you could not query or filter by the type when reading data (especially on Android).
Breaking changes
RecordingMethod
enum, containing the 4 values that Health Connect defines.isManualEntry
fromHealthDataPoint
in favor ofrecordingMethod
, of which the value is an enumRecordingMethod
includeManualEntry
(previously a boolean) in favor ofrecordingMethodsToFilter
, which is a list ofRecordingMethod
. This change affects the following functions for querying:getHealthDataFromTypes
getHealthIntervalDataFromTypes
getHealthAggregateDataFromTypes
is unaffected.recordingMethod
to write to HealthKit and Health Connect stores, and when querying the data again it will be included in the metadata. The default value isRecordingMethod.automatic
. This change affects:writeHealthData
writeWorkoutData
writeMealData
writeBloodPressure
writeBloodOxygen
writeMenstruationFlow
Other improvements