My First App: Orange Theory Fitness

Former Member
Former Member
Hey all,

Just wanted to showcase the first app I have written for Connect IQ.

https://apps.garmin.com/en-US/apps/b886d2ac-2f94-4f9d-a7bd-85a59b99e639

I have made it open source.

You can view the readme and source code at my Github repository.

Looking for feedback on code quality and methodology.

If you aren't familiar with Orange Theory you can read about it here.

Description
This Garmin Connect IQ App provides a display on your Garmin Device which closely matches the display seen on the screens in Orange Theory Fitness studios. It is intended to be used in-studio along with any of the official OTF heart rate monitors. Devices equipped with internal HRM's can use this sensor as well but it is not as accurate. The app will record an activity of type "SPORT_TRAINING" and sub-type "CARDIO". This activity and it's FIT data can be saved and sync'd with Garmin Connect just as any other fitness tracking app does.


Supported Devices
* Vivoactive HR

Menu Options and Settings
* Heart Rate Zones - Choose between the official Orange Theory Zone model or your User Profile Defined Model
* Allow Vibration - Enable or Disable Vibration. Enabling presents cues at start/stop of workout and when falling into the blue zone or going up into the orange/red zone.

Buttons and Interactions
* Screen tap on the splash screen will start the workout
* Screen tap during a workout will activate the device back light
* Back button on splash screen will exit the app
* Back button when the workout is active will pause the workout
* Enter button works as a start/stop button

Prompts
* If a Heart Rate is not detected upon starting the workout, user will be confirmed if they want to proceed. App does not function without a heart rate but this assumes the user will attach their heart rate monitor after starting the workout. This prompt will not be displayed on subsequent start/stop actions during a workout session.
* Upon stopping / pausing the workout a menu will be presented: Resume / Save / Discard. These are fairly self-explanatory.
* Upon saving the activity a workout summary screen will be displayed. The back or enter button on this screen will exit the app.

To Do and Planned Features
* Support Additional Devices
* Potentially allow for manual activity selection / switching during a workout

Calculations and Accuracy
The output of this app should very closely match that of the OTF Workout Summary. It may not be exact in all cases and is meant to be as close as possible.

* Max HR is calculated as per Orange Theory's method which is: (230 - Age) for Females and (225 - Age) for Males
* HR Zone Thresholds are: Blue - 61%, Green 71%, Orange 84%, Red 92%
* Calories Burned are calculated using Garmin's algorithms, not OTF's. This is because I do not know how to override that field in the FIT recording file.
* Splat Points are the total time in seconds in the Orange + Red Zones, rounded to the nearest minute.