Hi
Is there any list, graphic which shows when a callback is triggered on a specific device.
Its, because I found out that the onTimerReset is triggered on watches in the SIM and not on the real device.
If this one is wrong, I dont know which other callbacks are also called different in the SIM and the real device.
Because the edges behave differently than the watches when starting, stopping and pausing an activity.
Also when the initialize is called, because it behaves completely different in the sim.
Background:
I have an odometer value which is stored in the settings of the app, so the user can correct/clear this value if he wants to.
I am reading this value on initialize and writing it in onTimerReset. This did not work on the watches, because it was not called.
So I added it also in the onTimerStop. But on the watches sometimes the initialize is called and the value gets wrong because the elapsed distance
is reset on watches but not on the edges. It is really confusing.
var iTotalDistNew = 0; var iTotalDist = 0; function initialize() { .. var td = app.getProperty("td").toNumber(); iTotalDist = (td == null) ? 0.0 : td; .. } function onTimerStop() { Application.getApp().setProperty("td", iTotalDistNew.toString()); } function onTimerReset() { Application.getApp().setProperty("td", iTotalDistNew.toString()); } function compute(info) { iTotalDistNew = (iTotalDist + info.elapsedDistance).toNumber(); var Val2Display = iTotalDistNew.toFloat(); }
This does work on the watches, but not on the edges, because when the initialize is called the value is updated.
thanks
regards
Erich