'How-to' ideas: A 0-10 scale, selecting numbers using the Up and Down buttons

Former Member
Former Member

Hi all,

I'm new to the Garmin programming world (basic experience in Python and 'R') so will admit I'm a complete newbie. I have found some tutorials which I'm following to familiarise myself with it all.

I'd like to create a simple scale from 0-10 that I could use to select a number during a run, that would give a timestamp of when it was pressed and the distance e.g.:

4 (scale rating) - 3.2km (distance) - 15:31 (time)

7.5 (scale rating) - 8.0km (distance) - 32:46 (time)

Could anybody provide some ideas on what the best way to go about this might be?

Thanks in advance!

  • So, if you want to create a Connect IQ app that can record to an activity *and* accept user input, I think your only choice is to write a "device app" (assuming you don't want to take your phone with you).

    A "device app" is a fully-fledged app that completely replaces the built-in activity you're interested in (e.g. "Run"), which means you lose a lot of standard functionality (like maps, music, workouts, etc.). As a counter-example, a "data field" would allow you to enhance a built-in activity like "Run" instead of replacing it, but it doesn't accept user input (*).

    If you went the 'device app" route, you would have to:

    - Accept basic input like the START button to start and pause an activity, LAP button to take laps.

    - Handle activity recording. (This is pretty simple once you handle input, as all of the built-in metrics and sensor data will be automatically recorded for you, as long as you turn on the various sensors like the GPS)

    - Implement your own custom menu to handle the scale rating / timestamp functionality. Whenever the user takes a snapshot, you can record a custom value to the activity file, which will show up as a line-graphed value in the activity. It's not *exactly* what you're looking for, but it would work okay as long as you can have an invalid value like 0 to graph for all times when the scale rating was *not* recorded. When you're reviewing the activity on Garmin Connect you could fairly easily correlate the scale points to an activity time (although if you want to correlate them with an activity distance, you would have to use Garmin Connect Web rather than the mobile app.)

    - Implement display of basic activity metrics like pace, distance, and time. (This is the biggest pain. The metrics themselves are already available to you, but you would have to handle drawing the data fields yourself.)

    (*) For new CIQ 3.2 devices, data fields can accept input via "on-device settings", but I've been told that the data field restarts when you use this features, which might no be acceptable for your use case. I don't know for sure as I don't have a real CIQ 3.2 device, and I've also been told that the simulator behavior is different.

    Maybe someone who has experience with on-device settings for data fields can chime on whether you can access on-device settings view without restarting the data field app afterwards. If it's the case that accessing on-device settings for a data field does *not* restart the data field app, then you could use the settings view to accept any input you want.

    OTOH, if you're willing to run with your phone (and assuming this is just a personal app for you), you could implement a much simpler data field app that accepts settings changes from your phone. There could be single setting with the scale rating, and when the user changes this field and pushes settings to the watch, the data field would get a notification and could then write the value to activity (in the same way as described for the device app above.)

    This would save a lot of trouble with reinventing the wheel by reimplementing basic Run app functionality, but it also means that you have to run with your phone. (Personally I never run with my phone.)

    That's just my two cents -- maybe others have better ideas.

  • Also, technically there *is* a way for Connect IQ data fields to accept "input" (other than on-device settings), but it's not great.

    You can implement a hack based on the fact that data fields get a notification when they are hidden or shown.

    So assuming the user has more than one data field page, you can take action based on the user quickly hiding and showing the data field (e.g. pressing DOWN and UP quickly).

    Some obvious downsides:

    - This can be accidentally triggered (e.g. just through normal scrolling, or from pressing BACK when the activity is paused)

    - There really isn't a good way to map more than one action this way, unless you have something like:

      - Quick DOWN+UP x 1 = increment scale factor
      - Quick DOWN+UP x 2 = decrement scale factor
      - Quick DOWN+UP x 3 = save scale factor

    - Obviously this would be very tiresome for incrementing and decrementing a number, especially if the range of values is 0 to 10 (including decimals).

    If you don't care about messing up your laps, you could implement:

      - Quick DOWN+UP x 1 = increment scale factor (and allow wrapping from 10 to 0)
      - LAP = save scale factor

    (The problem here is you can't prevent the activity from also recording a lap at this point.)

    Or you could have an action based on pausing and un-pausing the activity very quickly:

      - Quick DOWN+UP x 1 = increment scale factor (and allow wrapping from 10 to 0)
      - Quick PAUSE+UNPAUSE = save scale factor

    Needless to say, these are all pretty hacky and not great UX at all.

  • It's also possible that even if accessing on-device settings restarts your data field, it wouldn't interfere with the functionality of your data field app (recording data points at the user's request). I can't know for sure because I don't own a device that supports on-device settings. IOW, I don't know what happens when a data field which records data restarts multiple times during a single activity.

    Relying on on-device settings would also mean that your app wouldn't work with older devices.

  • Former Member
    Former Member in reply to flowstate

    This is all super helpful. Thanks for taking the time to think about it and go into detail! Initial thoughts are to try the simple device app option and take it from there.

  • No worries! Good luck and let us know how it goes.

  • I'm a bit curious as to your app goal? What exactly does the rating represent?