Hi,
I'm writing a data field, but am running into problems. My data field seems to run well, but sometimes I get this error screen:
What does it mean and how can I fix it?
Thanks in advance!
Lorenzo
Hi Brian,
Thanks for your quick reply and explanation.
Does this mean there is no way around this limitation for the Fenix3?
What I do notice is that after I side-load the app on my Fenix, when I open the Bike app, the transition animation is very choppy (I have the data field set as Field 1). Do you have any idea what could be the cause?
I can share code if needed..
Choppy animations indicate your onUpdate function takes a long time to complete. You can use the millisecond timer from System.getTimer() to time your update function on hardware. Screen transitions run at about 10-20 frames/second, so you will want an on update < ~50-100ms to avoid choppy animations.
Currently, my onUpdate function checks !=null for 7 metrics by if-else statements.
I have doubts that it is the null checks that are the source of the slowdown. Yes, a null check is not free, but it *should* be extremely cheap when compared to drawing text or a bunch of lines.
How are you computing your 10s average?
For any of these you aren't already doing, I suggest:
Compute the average in the compute() function, not in onUpdate().
Use a circular buffer.
Instead of looping through your buffer each time to accumulate, keep the accumulation, subtract the element that is being removed, and add the element being inserted (this method should have a constant compute time regardless of the buffer size).
Well, that sounds like a circular buffer to me. (Contrary to shifting the items down each time data is received.)
The real question is if you are adding up the values and dividing by 10 in onUpdate(). This is what I would I think could be taking some time (you said this part took nearly half of your update time). This shouldn't be done in onUpdate(), because the result only changes when new data comes in via compute(), and onUpdate() can be called rapidly during transitions.
I also suggested optimizing the accumulation (adding the 10 numbers up) by computing it continuously.
... Pseudo code ..
Function compute(info)
At each i (up to I = 10) fill the array with a value. Once I=10, force I=0
Sum all the values in The array.
Average over 10s = sum over 10sec/10
Return value to calling function (I call this function from OnUpdate() )