Import and display workouts
HealthBridge normalizes HealthKit and Health Connect workouts into
FHealthBridgeWorkout records.
Import recent workouts
Section titled “Import recent workouts”In Blueprint, call Get Recent Workouts on HealthBridgeSubsystem after
successful initialization. Choose the number of days and maximum records your
screen actually needs.
In C++:
FHealthBridgeService::GetRecentWorkoutsDetailed( 7, 25, [](const TArray<FHealthBridgeWorkout>& Workouts, bool bSuccess) { if (!bSuccess) { return; }
for (const FHealthBridgeWorkout& Workout : Workouts) { // Add one view model or widget row per workout. } });Use the detailed result when your UI must distinguish a failed import from a
successful empty history. The simpler GetRecentWorkouts callback returns only
the workout array.
Display normalized fields
Section titled “Display normalized fields”Common fields include:
Id: provider record identifier.ExerciseType: normalized activity label.StartTimeandEndTime: UTC Unix milliseconds.Duration: milliseconds.- Optional calories, distance, and steps guarded by
bHas...fields. Location: indoor, outdoor, or unknown.Source: contributing platform or app.bIsAppCreated: whether the current app created the workout.
Workout summary distance is expressed in kilometers. Use Blueprint helper nodes to convert timestamps and duration instead of duplicating conversion logic.
Handle partial workouts
Section titled “Handle partial workouts”Platforms and source devices do not populate every metric. Hide an unavailable
metric when its bHas... flag is false. Do not render zero as though it were a
measured value.
Unknown exercise types can normalize to Other. Keep that label usable rather
than dropping the record.
Verify with curated mocks
Section titled “Verify with curated mocks”Use Tools > HealthBridge > Mock Workouts to create:
- A complete running workout.
- A workout without calories or distance.
- An indoor workout.
- An unknown or
Otherexercise. - An empty curated list.
Verify that the UI remains useful in every case.
