private void BeginReadingPedometer(DateTimeOffset startDate) { if (this.IsHealthDataAvailable()) { _StartReadingPedometerFromDate(DateTimeBridge.DateToString(startDate)); } else { Debug.LogError("Error: no health data is available. Are you running on an iOS device that supports HealthKit?"); } }
private void ReadCorrelation(HKDataType dataType, DateTimeOffset startDate, DateTimeOffset endDate, bool combineSamples) { if (this.IsHealthDataAvailable()) { string identifier = HealthKitDataTypes.GetIdentifier(dataType); _ReadCorrelation(identifier, DateTimeBridge.DateToString(startDate), DateTimeBridge.DateToString(endDate), combineSamples); } else { Debug.LogError("Error: no health data is available. Are you running on an iOS device that supports HealthKit?"); } }
private void ReadWorkout(WorkoutActivityType activityType, DateTimeOffset startDate, DateTimeOffset endDate, bool combineSamples) { if (this.IsHealthDataAvailable()) { int identifier = (int)activityType; _ReadWorkout(identifier, DateTimeBridge.DateToString(startDate), DateTimeBridge.DateToString(endDate), combineSamples); } else { Debug.LogError("Error: no health data is available. Are you running on an iOS device that supports HealthKit?"); } }
/*! @brief Write a workout sample. * @details * @param activityType The workout activity type to write. * @param startDate The starting date of the sample to write. * @param endDate The ending date of the sample to write. * @param calories The kilocalories burned during the activity * @param distance The distance traveled during the activity (for e.g. running) * @param handler Called when the function finishes executing. */ public void WriteWorkoutSample(WorkoutActivityType activityType, DateTimeOffset startDate, DateTimeOffset endDate, double calories, double distance, WroteSample handler) { this.wroteSampleHandlers[HKDataType.HKWorkoutTypeIdentifier] = handler; if (this.IsHealthDataAvailable()) { int identifier = (int)activityType; _WriteWorkout(identifier, DateTimeBridge.DateToString(startDate), DateTimeBridge.DateToString(endDate), calories, distance); } else { Debug.LogError("Error: no health data is available. Are you running on an iOS device that supports HealthKit?"); } }
/*! @brief Write a category sample. * @details * @param dataType The datatype to write. * @param value the (integer) value to use to create a sample. * @param startDate The starting date of the sample to write. * @param endDate The ending date of the sample to write. * @param handler Called when the function finishes executing. */ public void WriteCategorySample(HKDataType dataType, int value, DateTimeOffset startDate, DateTimeOffset endDate, WroteSample handler) { this.wroteSampleHandlers[dataType] = handler; if (this.IsHealthDataAvailable()) { string identifier = HealthKitDataTypes.GetIdentifier(dataType); _WriteCategory(identifier, value, DateTimeBridge.DateToString(startDate), DateTimeBridge.DateToString(endDate)); } else { Debug.LogError("Error: no health data is available. Are you running on an iOS device that supports HealthKit?"); } }
private void ReadQuantity(HKDataType dataType, DateTimeOffset startDate, DateTimeOffset endDate, bool combineSamples) { if (this.IsHealthDataAvailable()) { string identifier = HealthKitDataTypes.GetIdentifier(dataType); string startStamp = DateTimeBridge.DateToString(startDate); string endStamp = DateTimeBridge.DateToString(endDate); Debug.LogFormat("reading quantity from:\n-{0} ({1})\nto:\n-{2} ({3})", startDate, startStamp, endDate, endStamp); _ReadQuantity(identifier, startStamp, endStamp, combineSamples); } else { Debug.LogError("Error: no health data is available. Are you running on an iOS device that supports HealthKit?"); } }
public DateTimeOffset endDate; /*!< the ending date of this sample */ // sample type /*! @brief The default constructor. * @param node the XmlNode to create this object from. */ public Sample(XmlNode node) { this.startDate = DateTimeBridge.DateFromString(node["startDate"].InnerText); this.endDate = DateTimeBridge.DateFromString(node["endDate"].InnerText); }
public int numberOfSteps; /*!< the number of steps taken in this sample */ // sample type /*! @brief The default constructor. * @param node the XmlNode to create this object from. */ public PedometerData(XmlNode node) { this.startDate = DateTimeBridge.DateFromString(node["startDate"].InnerText); this.endDate = DateTimeBridge.DateFromString(node["endDate"].InnerText); this.numberOfSteps = Convert.ToInt32(node["numberOfSteps"].InnerText); }
/*! @brief The default constructor. * @param node the XmlNode to create this object from. */ public DateOfBirthCharacteristic(XmlNode node) { this.value = DateTimeBridge.DateFromString(node.InnerText); }
public WorkoutEventType eventType; /*!< either Pause or Resume */ /*! @brief The default constructor. * @param node the XmlNode to create this object from. */ public WorkoutEvent(XmlNode node) { this.date = DateTimeBridge.DateFromString(node["date"].InnerText); this.eventType = (WorkoutEventType)Int32.Parse(node["eventType"].InnerText); }