onUpdate() Loop Bug?

I've written a few Garmin Edge data fields for the 520 device. The onUpdate() reliably runs every second. I cycle a data field showing different values every 2 seconds.

I just got an 820. Weird behavior. When running a "route", onUpdate() sometimes will only run every 6 to 8 seconds. And if I stop and then restart an activity, all of a sudden, onUpdate() seems to run many times a second.

Anyone else seeing this?
  • The onUpdate() method will be called as frequently as is needed, you should not count on it being exactly one second. You should draw what you need to on every call to onUpdate(). I'm not saying you shouldn't be reporting a bug (it sounds like you may have found one), just that your expectation not consistent with the intended behavior.

    The compute() function is supposed to be called once a second, and it should do this regardless of anything that the user does or how their device is configured.

    When writing a data field, you should separate the display of the data from the collection and calculation; data display goes in onUpdate() and calculation goes in compute(). If you write your code this way everything should work out.

    Travis
  • There is a major issue with the Garmin Edge 820. When running a route, the COMPUTE() call is delayed from once a second to once every 10 seconds or more!! This occurs not only for custom Connect IQ apps, but even the built-in functions. For example, enabling Battery Save mode in the 820, it counts down from 3/2/1 seconds to blank the screen. When running a route, that countdown takes about 10 seconds to go from 3 and 2, from 2 to 1 and from 1 to blank.