This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

anyone can give a sample on how to use ActivityMonitor.getHistory

Former Member
Former Member
really puzzled on how to use this array, no description can be found.
  • This is a better question for the Connect IQ Developer forum at:
    https://forums.garmin.com/forumdisplay.php?479-Connect-IQ

    What is it you're trying to do? Basically, you get an array that has 0 to 7 elements, and loop through it. He's simple code that walks through the history and totals the steps.
    var activityHistory = Act.getHistory();
    var histDays=activityHistory.size();
    stepHistory=0;
    for(var i=0;i<histDays;i++) {
    stepHistory=stepHistory+activityHistory.steps;
    }
    [/code]