ActivityMonitor.getInfo() idles

In my watch app, I noticed that ActivityMonitor.getInfo() does not update my step count from the time when onHide is typically called (e.g. when I am not looking at my watch). Apparently (of course!) the steps continue to be counted during this time, but obviously ActivityMonitor is not getting updated. This seems to be a weird behavior that I don't understand. Is there a reason for this?

  • Are you sure you're actually making the call?  Where is it called from - onUpdate, a timer, etc?

  • I am calling it from a timer every second.

  • Maybe you should open a bug report for this. Maybe Garmin will confirm whether this is an intentional design decision or not.

  • It works fine for me in devices apps.

    For example, https://apps.garmin.com/en-US/apps/116a5b59-29ae-4397-a70e-907d7e5f8e44

    I suspect it's something that's app specific.

  • Are there cases where you stop the timer of does it always run when your app is running?

  • The timer is set like this:

    class Controller {
    	
    	hidden var _fitManager;
    	hidden var _myView;
    	
    	function initialize() {
    		_fitManager = Application.getApp().fitManager;
    		_myView = Application.getApp().myView;
    		timerUpdate = new Timer.Timer();
    		timerUpdate.start(method(:removeInitViewAndStartUp), 1200, false);
        }
    
        function removeInitViewAndStartUp (){
        	WatchUi.switchToView(_myView, new MyDelegate(), WatchUi.SLIDE_RIGHT);
    		timerUpdate.start(method(:updateEverySecond), 1000, true);
        }
        
    	function updateEverySecond(){
    		_fitManager.updateFitData();
    	    WatchUi.requestUpdate();
    	}
    	
    	// ...
    }

    Within fitManager.updateFitData:

    class FitManager {
    
    	hidden var stepsLast = 0;
    	
    	// ...
    
        function updateFitData(){
            setStepsLast();
    	}
    	
    	function setStepsLast (){
        	if (ActivityMonitor.getInfo().steps != null){
    	    	if (ActivityMonitor.getInfo().steps > stepsLast) {
    	    		stepsLast = ActivityMonitor.getInfo().steps;
    			} 
    			else {
    			    // !!!
    			    // This is called if ActivityMonitor.getInfo().steps did not update
    			    // or if indeed no new steps were counted.
    			    // !!!
    			}
    	    }
        }
    	
    	// ...
    
    }

  • Garmin does some interesting things with steps - for example "10 or more" on some devices,  If you take 9 steps and then stop, you may not see a change.  It's a way they reject arm movement without talking a step.  Make sure you are walking enough at one time for the data to change.

    If you are just testing at your desk, you may not see any change.

  • Understand that with all that's involved, you may only see steps update a few times a minute.  You can verify this is you have a WF that uses onPartialUpdate and use it for steps,

  • Here is an example fit file record of my app where I saved the time between steps during an activity: 

    https://services.garmin.com/appsLibraryBusinessServices_v0/rest/apps/03644288-d83e-40f3-a7cf-a9c7b0eec6e1/screenshots/232d3a3e-9f85-4a1a-b1c4-e6adc88e159c

    Whenever no new steps where given by ActivityMonitor.getInfo().steps, I increased the time counter. 

    As you can see, there are several spikes where my counter kept increasing. In fact, most of the peaks show that I looked at my watch during the activity...

  • I have tried your app today. In fact, also your step count does not update all the time. It tends to pause sometimes - similar to the observation in my watch app. I guess that this is rather an issue with the ActivityMonitor then. I don't know if it is watch related though. I will ask my friends to use my app as well to see if they can reproduce the behavior (similar to https://services.garmin.com/appsLibraryBusinessServices_v0/rest/apps/03644288-d83e-40f3-a7cf-a9c7b0eec6e1/screenshots/232d3a3e-9f85-4a1a-b1c4-e6adc88e159c )