After upgrade the SDK from 7.2.1 to 7.3.0, I found that playing animation consumes much more battery. After debug I found the when playing AnimationLayer, onUpdate() is called for dozens of times in one second. In SDK 7.2.1 onUpdate() is called only once a second. onUpdate() will draw the screen and is heavy. It's called for so many times and will consume too much battery.
This is the test code copied from Garmin example in SDK: AnimationWatchFace. Nothing is changed except adding the following println() for debug::
//! Update the view
//! @param dc Device Context
public function onUpdate(dc as Dc) as Void {
// Update the entire draw layer
var clockTime = System.getClockTime();
var seconds = clockTime.hour*3600 + clockTime.min*60 + clockTime.sec;
System.println("seconds: " + seconds);
updateWatchOverlay(true);
}
I tested fenix7 on the simulator and this is the test result, Can somebody help on it? Is it expected or a bug? Thanks.
1) This is the output in SDK 7.2.1, we can see onUpdate() are called once in 1 second::
seconds: 59506
onComplete: 18
play: 18
seconds: 59507
onComplete: 19
play: 19
seconds: 59508
seconds: 59509
onComplete: 20
play: 20
seconds: 59510
seconds: 59511
seconds: 59512
onComplete: 21
play: 21
2) This is the output in SDK 7.3.0, we can see onUpdate() are called about 25 times in 1 second::
seconds: 59601
seconds: 59602
seconds: 59602
seconds: 59602
seconds: 59602
seconds: 59602
seconds: 59602
seconds: 59602
seconds: 59602
seconds: 59602
seconds: 59602
seconds: 59602
seconds: 59602
seconds: 59602
seconds: 59602
seconds: 59602
seconds: 59602
seconds: 59602
seconds: 59602
seconds: 59602
seconds: 59602
onComplete: 1
play: 1
seconds: 59602
seconds: 59602
seconds: 59602
seconds: 59602
seconds: 59602
seconds: 59603
seconds: 59603
seconds: 59603
seconds: 59603
seconds: 59603
seconds: 59603
seconds: 59603
seconds: 59603
seconds: 59603
onComplete: 2
play: 2
seconds: 59603
seconds: 59603
seconds: 59603
seconds: 59604