Commit Graph
10 Commits
Author SHA1 Message Date
835884ab16 Add device-agnostic FIT activity export (#6268)
Adds FIT file export for activity tracks, alongside the existing GPX export:

- **`FitExporter`** — builds a valid FIT activity (file_id / session / lap / record, plus length / split / set when present) from an `ActivityTrack` + `ActivitySummaryData`.
- **`AutoFitExporter`** + **`AutoExportFitSettingsActivity`** — opt-in auto-export on sync, mirroring the GPX auto-export setting (per-device or all-devices).
- **"Share FIT File"** action in the workout detail menu.

Export is fed device-agnostically: `GarminWorkoutParser` and the shared model (`ActivityTrack` / `ActivityPoint` / `ActivitySummaryEntries` / `ActivityKind`) carry laps, segments, per-length swim, splits/sets, running dynamics and HR zones.
The Garmin FIT codec (`messages`, `baseTypes`, `NativeFITMessage`, `RecordData`) is extended to encode them.

`AutoFitExporter.doExport(...)` is wired beside `AutoGpxExporter` in the Garmin, CMF, Huawei, BangleJS, Huami and Xiaomi activity paths; `FitImporter` also honours the FIT auto-export toggle.

## Testing

`:app:testMainlineDebugUnitTest` — FIT/export subset green:

- `FitExporterReadmeRoundTripTest` — round-trips the curated README sample **and** the full `Activity/<year>/` corpus for years ≥ 2015 from  https://github.com/ThomasKuehne/FIT-test-files (3482 files): parse → export → re-parse, asserting GPS/altitude/HR/speed/cadence/distance/power/temp and session aggregates survive.
- `FitExporterPaceTest`, `BaseTypeEncodeRoundTripTest`, `GarminSportTest`, `GPXExporterTest`, `FitImporterTest`, `GpxRouteFileConverterTest`, `FitWeatherTest`.

Thanks a lot to @ThomasKuehne for the initial review

Co-authored-by: Dany Mestas <94061157+DanyPM@users.noreply.github.com>
Reviewed-on: https://codeberg.org/Freeyourgadget/Gadgetbridge/pulls/6268
2026-06-21 23:35:20 +02:00
José Rebelo 58d6d670f7 Introduce ActivityTrackProvider 2026-03-21 21:55:03 +00:00
José Rebelo bba80d3c60 Huami: Improve workout charts for activities without gps 2025-12-20 19:12:14 +00:00
José RebeloandDaniele Gobbetti 0b07f36817 Garmin: Persist and display activity
- Steps, hr, intensity
- Sleep stages
- Stress
- SpO2
- Workouts
2024-05-24 22:24:08 +02:00
FYG_license_bot_ignore_meandDaniele Gobbetti 4c7476845b Update license headers and CONTRIBUTORS file 2024-01-10 19:01:48 +01:00
José Rebelo 76d99f1c33 Zepp OS: Start new GPX segments on pause/resume 2023-05-14 16:22:32 +01:00
License BotandAndreas Shimokawa d6fa5d0dd5 Update license headers 2020-01-09 10:44:32 +01:00
License BotandDaniele Gobbetti beedb653e6 Update license headers 2019-02-13 20:43:31 +01:00
License BotandDaniele Gobbetti 225a600aed Update license headers 2018-06-25 18:35:46 +02:00
cpfeiffer f5318287c4 WIP: Bip GPS fetching, parsing, exporting
Also adjust Mi2 date/time sending wrt DST offsets
2017-10-31 23:16:39 +01:00