1.0.0
This version introduces the following changes:
- Add ability to interact with the
Nutrition
data type (i.e. check/request permission and read/write data). Example:// Check permission kHealth.checkPermissions( KHPermission.Nutrition( readBiotin = true, writeBiotin = true, readCaffeine = true, writeCaffeine = true // This class allows you to request for the precise permissions // that you require with total 38 food/nutrition values ), ) // Request permission kHealth.requestPermissions( KHPermission.Nutrition( readBiotin = true, writeBiotin = true, readCaffeine = true, writeCaffeine = true // and many more params in this class (like VitaminA, Zinc, Protein, etc.) ), ) // Write Nutrition kHealth.writeRecords( KHRecord.Nutrition( name = "KHealth Sample Meal", startTime = Clock.System.now() - 10.minutes, endTime = Clock.System.now(), mealType = KHMealType.Snack, solidUnit = KHUnit.Mass.Gram, biotin = 0.00003, caffeine = 0.45, // and many more... ), ) // Read Nutrition kHealth.readRecords( KHReadRequest.Nutrition( startTime = startTime, endTime = endTime, // Optional solidUnit = KHUnit.Mass.Gram, energyUnit = KHUnit.Energy.KiloCalorie ) )
Note
Nutrition supports the following types of food items
Biotin, Caffeine, Calcium, Chloride, Cholesterol, Chromium, Copper, DietaryFiber, Energy, FolicAcid, Iodine, Iron, Magnesium, Manganese, Molybdenum, MonounsaturatedFat, Niacin, PantothenicAcid, Phosphorus, PolyunsaturatedFat, Potassium, Protein, Riboflavin, SaturatedFat, Selenium, Sodium, Sugar, Thiamin, TotalCarbohydrate, TotalFat, VitaminA, VitaminB12, VitaminB6, VitaminC, VitaminD, VitaminE, VitaminK, Zinc
- Remove
KHDataType
andKHPermissionStatus
classes to make user's learning curve easier
Warning
THIS IS A MAJOR CHANGE 👆🏼