What's the point of starting an app every five minutes in a watch that doesn't support Glance (ie Venu)

Hi, to help finding when a log trace starts when debugging, I've added "Starting app" in the Initialize function.

(:background)
class TeslaLink extends App.AppBase {

    function initialize() {
logMessage("Starting app");
        AppBase.initialize();
    }

To my surprise, the following was shown in the log file on my watch

9:08:04 : Starting app
9:13:03 : Starting app
9:18:04 : Starting app
9:23:04 : Starting app
9:28:04 : Starting app
9:33:05 : Starting app
9:38:06 : Starting app
9:43:06 : Starting app
9:48:06 : Starting app
9:53:06 : Starting app
9:57:15 : Starting app
9:57:47 : Starting app
9:57:47 : stateMachine vehicle_id 1493038771190796 vehicle_state online _need_auth false _auth_done true _check_wake false _need_wake false _wake_done true
9:57:47 : StateMachine: Requesting data
9:57:49 : onReceiveVehicleData: responseCode is 408
9:57:50 : stateMachine vehicle_id 1493038771190796 vehicle_state online _need_auth false _auth_done true _check_wake true _need_wake false _wake_done true
9:57:50 : StateMachine: Getting vehicles list
9:57:51 : onReceiveVehicles:responseCode is 200
9:57:51 : stateMachine vehicle_id 1493038771190796 vehicle_state asleep _need_auth false _auth_done true _check_wake false _need_wake true _wake_done false

I didn't launch the app every five minutes so the watch is itself calling the app Initialize function. I'm guessing it's doing that for every other apps I have installed too. I could see on a watch that support Glance to do this to update the glance data, but what good does it do on a watch without Glance support?

Just curious on why it does that as I find it wastes resources for no apparent gain.

  • Not sure I understand what that means

    "Since you don't have a backgrounding schedule for non-Fenix devices, your "entire" background app instance will never be ever started"

    For non-glance devices the main instance of the app will be started in foreground, as usual. The second (background) instance of the app will never be started, because you don't call registerForTemporalEvent() in any place. 

  • Thanks. Does it mean though that a watch with glance support will launch the whole app in the background since I'm not telling which code to run in the background? Usually a watch has less room for background than foreground and what happens if it can't fit in the background space?

    I think at this point I'll just cut my losses and keep the code as is, having an inactive background process for watch without glance support. It's the least of the two evils in my opinion.

  • The compiler is not so smart to notice at the compile time that you don't have registerForTemporalEvent() call at all. It only processes permissions-annotations relationships at the compile time - finds that you do have the Background permission but do not have the (:background) annotation. That's it, this is the only reason for the compiler warning message. Actual backgrounding will be started only based on the registerForTemporalEvent() invocation.

  • Ok, thanks for the explanation.