@assaf1007 You are using two different strings for getObject and setObject.
This should be a minimal working example which pushes settings.active up by 1 whenever you start an exercise:
var settings = null;
function onLoad(input, output) {
settings = {
maxPace: 12,
timelapse: 123,
active: 0,
};
loadSettings()
}
var loadSettings = function () {
var loaded = localStorage.getObject("appSettings");
if (loaded != null) settings = loaded;
// else localStorage.setObject("appSettings", settings);
settings.active++;
localStorage.setObject("appSettings", settings);
};
function evaluate(_inp, _out) {
setText("#active", String(settings.active))
}
function getUserInterface() {
return {
template: 't'
};
}
and the html:
<uiView>
<div>
<div id="active" class="p-m">
0
</div>
</div>
</uiView>
So:
but i wish to be able to set values at the watch itself (if possible) … in such case, i need (= user need) some kind of a preliminary UI (before app starts) to be able to update settings…
Possible indeed! The ‘tennis score pro’ application has a start screen which saves the settings for the next time.