My gpsservice now has a settings.json file in which I store "service": true/false.
Most of the settings examples call the reload() function on the widget but really all I want to do is save the values.
I notice that when you exit the settings App this causes the widget to be restarted.
I dont think its a good idea to call reload() inside the draw() function.
Is there a way to call reload() when the widget is restarted such that it determine its state and what to do ?
Also I would ideally want to call the Bangle object to determine if GPS is on or not, rather than try and track it through variables in the widget.
When you change apps, everything is completely restarted - so actually I guess you don't need reload() at all - you can just read the settings in the widget once when it's first executed and everything will be fine.
Unfortunately right now there's no way to get the state of GPS/HRM/etc in Bangle.js - I know it's a bit annoying and it's something I'm planning to add into later firmwares.
Don't worry about formatting, just type in the text and we'll take care of making sense of it. We will auto-convert links, and if you put asterisks around words we will make them bold.
For a full reference visit the Markdown syntax.
© Espruino, powered by microcosm.
Report a problem