Get current step count during activity in watch app

How can I get the current steps other than using ActivityMonitor.getInfo().steps in my own watch app?

I have just implemented my own watch app where I also want to show cadence (where I use the currents steps for). It works so far but I noticed that ActivityMonitor.getInfo().steps is always a bit behind and takes a while to react on my watch.

I guess using the accelerometer data of the sensor could work? docs for AccelerometerData

Is there another way, I could get data on a more frequent basis?

  • Why not just use cadence in Activity.getActivityInfo()?

    You get current, max, and avg cadence.

  • Does Activity.getActivityInfo().currentCadence always work on watches without additional equipment? In fact, I am doing this:

    function recordCadence(){
    	var currentCadence = Activity.getActivityInfo().currentCadence;
        if (currentCadence != null && currentCadence != 0){
        	cadence = currentCadence;   // cadence is the variable which stores the actual cadence
    	} 
    	else {
    		var currentSteps = ActivityMonitor.getInfo().steps;
    		// ... calculate cadence by my own method ...
    	}
    }

    But apparently my watch is very slow in reacting on movement of my arm. I thought that is this due to the fact that  Activity.getActivityInfo().currentCadence does not work and my own calculation is just a bit delayed as I am using ActivityMonitor.getInfo().steps.

  • I show both Activity cadence and steps (both daily and during the activity). in Hike 2.  Using steps is a bit more complex in that you need to consider when the recording is paused and also midnight (when steps resets).  Yes, I did get a user report the midnight issue.

    Cadence seems to have a minimum where if it's below a certain number, it's reported as 0.  Also, based on sport you may see it as rotations, and not steps, so 1/2 steps.

  • Does Activity.getActivityInfo().currentCadence always work on watches without additional equipment? In fact, I am doing this:

    I think most, if not all, watches with Connect IQ support have built-in support for cadence measurement using the accelerometer. (Certainly every current-gen watch should have this support)

    When you use the built-in running activity, for example, you should get cadence without any additional equipment.

    What's returned in ActivityInfo.currentCadence (and maxCadence, averageCadence) should match what you would see in a native activity (and what would be recorded to the activity that syncs to Garmin Connect.). e.g. If you write a data field to display currentCadence, and install side-by-side with the native cadence field, their values should be identical. I confirmed this real quick with a data field of mine that displays configurable data. My data field showed the same cadence as the native field, with a very slight lag (less than 1 second.)

    Personally, I would prefer to show native data where possible (gathered/calculated with Garmin's own algorithms), as opposed to deriving stuff myself.

    I do see noticeable lag (with respect to my physical movements) with the native data field both the wrist accel and an external footpod, but I'm not sure if we can do better than the cadence that the watch already reports. (For example, who's to say there isn't a lag with accumulating steps? Do steps even accumulate once per second?)

    And a CIQ data field of mine which I configured to display currentCadence lags very slightly behind the native data field (less than 1 second).

  • If I try my app with the Simulator, the app will always uses Activity.getActivityInfo().currentCadence and the fit data is recorded like this accordingly.

    However, I tried my app outside today with my Fenix 6S Pro. What I find is that my cadences drops to zero whenever I am not looking at the watch. As soon as I look at it, it might take a few seconds until it displays a change of the cadence. As I use some smoothing in my own method, I can see that the cadence raises from zero to the actual value which is clearly indicating that my own method with ActivityMonitor.getInfo().steps is called. Hence, Activity.getActivityInfo().currentCadence is apparently not available.

    Could it be that Activity.getActivityInfo().currentCadence only works for certain sessions with for example SPORT_RUNNING? I am using :sport=>ActivityRecording.SPORT_INLINE_SKATING
    :subSport=>ActivityRecording.SUB_SPORT_GENERIC.

  • Could it be that Activity.getActivityInfo().currentCadence only works for certain sessions with for example SPORT_RUNNING? I am using :sport=>ActivityRecording.SPORT_INLINE_SKATING
    :subSport=>ActivityRecording.SUB_SPORT_GENERIC.

    Yep, that's probably it.

    See this:

    https://apps.garmin.com/en-CA/apps/d9c59377-1142-4a0e-8831-ce42d48dbd66?tab=reviews&criteria=rating&ascending=true&displayCurrentVersion=false

    "With the inskating activity, Garmin disabled the watch cadence accelerometer in certain watches, so using a foot pod is necassary."

    So I guess you were right -- for inline skating, you either need to ask the user to use a footpod, or use your own measurement method.

  • Thanks for this insight! What can I say... This is quite disappointing.

    However, then back to my own method: The ActivityMonitor.getInfo().steps seems not to work neither because it is only giving no update occasionally when not looking at the watch (which I am not doing all the time during my activity) while indeed "0" new steps within a certain period of going downhill could be a valid value as well.

    Do you have an idea how to circumvent this issue?

    The accelerometer is a quite nasty solution as I would need to run all testing on my device which is much more effort than using the simulator. And everything just to get the same results Garmin could potentially provide anyway...

  • I doubt there's any way around it except to use an activity type that supports cadence from accel.

    I'm sure Garmin has their own reasons for disabling cadence from accel for inline skating -- maybe they think it isn't reliable in that case?

    You could file a bug report and at least confirm that it's working as designed.

  • Ok, I will try. Where can I file a bug report?

  • https://forums.garmin.com/developer/connect-iq/i/bug-reports

    I suspect that is a firmware design decision that isn't directly related to Connect IQ (and probably won't change), but maybe someone from Garmin can confirm that for you.