You are on page 1of 1

That line ensures that the timer is gracefully terminated before the

recording stops.
Before you try to run this app, right-click RecordSample in Project
Explorer, select Properties, go to Connect IQ, and check FitContri‐
butor under Permissions. Click OK.

Permissions
Because users and devices have such an intimate connection, the
device knows a lot about an individual user. Most of this informa‐
tion is sensitive, so Connect IQ will not let your app access this
information without permission. When you develop your app, you
need to specify which permissions it needs.
When users install your app, they’ll be notified of which permis‐
sions your app has requested. If they are not comfortable granting
those permissions, they may decide to not install your app, or may
not use certain features in it. So you should only specify the permis‐
sions your app actually needs here.

Here’s the part of the RecordSampleView.mc file that you modified,


with new lines shown in bold (some long lines have been wrapped
from the original so it fits on the page):
using Toybox.WatchUi as Ui;
using Toybox.Graphics as Gfx;
using Toybox.System as Sys;
using Toybox.Lang as Lang;
using Toybox.ActivityRecording as Record;
using Toybox.FitContributor as Fit;
using Toybox.Timer as Timer;

var session = null;

class BaseInputDelegate extends Ui.BehaviorDelegate


{
var mFooField;
var mFooValue = 0;
var fooTimer = null;

function updateFoo() {
mFooValue = mFooValue + 1;
mFooField.setData(mFooValue);
}
function onMenu() {
if( Toybox has :ActivityRecording ) {

Personal Data Tracking | 39

You might also like