-
@Gordon and @halemmerich have given some pointers following comment #63 in the POC-thread. Information on how to declare functions with
let
to have them cleared on app exit is in comment #48.It basically boils down to:
- Wrap all your app code inside outer curly brackets:
{ all app code inside }
- Initialize variables with
let
orconst
, to utilize garbage collection. - Define functions by:
let myfun = function() { ... }
instead offunction myfun() { ... }
, also to utilize garbage collection. - Add to Bangle.setUI:
remove : someRemoveFunction
- EDIT as per @halemmerich's post below: Clear timeouts/invervals etc in
someRemoveFunction
in the step above. - Use
Bangle.showLauncher()
,Bangle.showClock()
orBangle.load()
instead ofload()
.
For now it's generally best to only implement fast switching between clocks and launchers, and not for launching other apps or switching between them.
There're also instructions going into the hardware reference here following line 5171.
Examples where it's implemented: Slope clock, Desktop Launcher.
EDIT: Using the RAM Widget have helped me during development. @Gordon has also suggested entering
process.memory().usage
into the console field of the Web IDE to get precise measurements. See @halemmerich tips below as well. - Wrap all your app code inside outer curly brackets:
yes.
Bummer, I hoped it was easier. Could you guys help me to tidy up the watchface somehow?
It might look as I'm a programmer, but most I do is copy&paste (like a senior programmer - but without the background knowledge :) )