ActivityMonitor on Edge 830

According to the documentation ActivityMonitor is from CIQ 1.0.0 and ActivityMonitor.INVALID_HR_SAMPLE is from CIQ 1.2.2, but I got reports that it fails on Edge 830 and indeed even on the simulator it fails:

In my manifest I have: minSdkVersion="1.3.0"

This is my code:

if (heartRate != null && heartRate != ExtHRMSensor.INVALID_HR && heartRate != ActivityMonitor.INVALID_HR_SAMPLE) {
   // ...
}

And when I run on Edge 830 in simulator I get this error: 

Error: Symbol Not Found Error
Details: Could not find symbol 'ActivityMonitor'

or

Error: Symbol Not Found Error
Details: Failed invoking <symbol>

Is this a bug in the documentation?

  • The edge devices don't have ActivityMonitor as they don't record steps or the other watch related activity stats.  The edge devices only have access to the sensor data.  I think the missing supported devices is a bug in the docs online.

    Edit:  The docs supplied in the SDK does list the supported devices for the main ActivityMonitor page and there are nothing but watches listed.

  • unfortunately you have also check devices not only version

    what do you need to read from activity monitor?

  • Something similar is SensorHistory - it's only available on watches, not edge devices or hand helds.

  • Basically what I need is something like this:

    if (heartRate != null && heartRate != ExtHRMSensor.INVALID_HR
        && (Toybox has :ActivityMonitor && ActivityMonitor has :INVALID_HR_SAMPLE && heartRate != ActivityMonitor.INVALID_HR_SAMPLE)) {
      result = heartRate.format("%d");
    }

    But this just adds code and this is not even true, so I'll just replace it with:

    if (heartRate != null && heartRate != ExtHRMSensor.INVALID_HR
    && heartRate < 255) { /* ActivityMonitor.INVALID_HR_SAMPLE - Edge 830, Edge 1030 might not have ActivityMonitor */

      result = heartRate.format("%d");
    }

  • If you are doing a DF or device App for the edge, you want to get the heart rate from Activity.Info or Sensor.Info (device app) and in a device app, you want to enable SENSOR_HEARTRATE for a device app.  In both cases, null indicates it's invalid.  You can also do this in watches.  You appear to be using getHeartRateHistory() which can be a couple minutes old.

    Activity.Info can even be used in watch faces to show WHR in "real time". (with onPartialUpdate)

  • no, my main source is ANT HR monitor, only by-the-way I display also the internal optical heart rate if the user enables it in the settings. In Fenix 6 it works. Now I also made this fix for the check if the value is 255.
    Ill check that I don't have any other place where I use Activity.Info

  • So you don't need ActivityMonitor on any device the way it sounds.  You can just use Activity.Info or Sensor.Info for the ORH (null means no value) and with ANT, whatever value it uses for no HR.  You also need to make sure the external HRM isn't paired to the device or trying to connect with ANT will fail if it's already connected as a native sensor