• Maybe I'm not doing things right, to return to the main menu from the application I hold down button 3. In this way, applications that should remain active in the background such as the countdown timer or a stopwatch come out and stop running.

    1) is it correct to keep button 3 pressed to return to the main menu?
    2) if it is correct, how can I do on the programming side to ensure that my app is always in the background?

    Thank you!

  • 1) is it correct to keep button 3 pressed to return to the main menu?

    Yes, it is...

    2) if it is correct, how can I do on the programming side to ensure that my app is always in the background?

    Realistically you need to make a widget (http://www.espruino.com/Bangle.js+Widget­s) or just a file called myapp.boot.js that will always run at startup. You can't persist data in RAM when the app changes, so you'd need to write state to Storage. So for example for a countdown timer you just store that it's in progress and the start time and you're fine (I guess looking at how alarms work might be helpful there).

    I feel like your next question is probably: why can't my app persist?

    The simple answer is: we can't trust apps.

    There's so little memory available that we really need to make sure there's no memory 'leaking'.

    If I were to allow apps to 'unload' themselves such that we could flip between them while keeping other things running, chances are a decent amount of them wouldn't do it correctly. The experience for users would be really bad (with the watch breaking every few app changes).

    Of course you can do it yourself. Kitchen Combo is an example of an app that contains several parts which you can flip between - and which all load and unload dynamically.

  • Why it is not a default setting for processes is clear to me but in some cases I believe it is essential to have a process that remains in the background for the time necessary. I see more as a problem the correct coding of applications with the exit of the correct process at the right time.

    Thanks anyway for the explanation, slowly I'm getting to know this fantastic project better!

  • @Gordon - interested to look at examples of apps that do the myapp.boot.js trick.

  • alarm is the obvious one I think

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

"back" button and keep the application in the background

Posted by Avatar for uname @uname

Actions