Correct way to add lap data

What is the correct way to add data to the lap summary? So far no data shows op in GCM (but the session data works).

What I am roughly doing:

  1. session = ActivityRecording.createSession({:name, :sport, :subsport});
  2. lapfield = session.createField(label, 3, FitContributor.DATA_TYPE_UINT32, {:mesgType => FitContributor.MESG_TYPE_LAP});
  3. session.start();
  4. lapfield.setdata(data);
  5. session.addLap();
  6. session.stop();
  7. lapfield.setdata(data);
  8. session.save();

And in my fitcontributions.xml:

<fitField id="3" displayInChart="false" sortOrder = "4" displayInActivityLaps="true" precision="0" dataLabel="@Strings.label" unitLabel="@Strings.unitlabel"/>

When I install the device app on my VA3 via beta upload, only the standard lap data but not my custom data is shown. My custom session data does appear in the activity summary.

What am I missing?

Kind regards, Maartje

  • Ok, never mind. You can scroll horizontally through the fields. :-o Is there any to get rid of the data fields I am not interested in? Or overwrite standard fields?

  • We can't override native fields.

    However I d also like to hide stuff like distance, speed, calories in laps I record in my app. There are not relevant information. If anyone know if there is a way to do it, let me know!

  • If you've implemented a watch-app, you should only get distance and speed if a position or speed source is available. If you don't turn on GPS (Position.enableLocationEvents()) and the user does not have a footpod or speed sensor, I'd expect you'd get no distance or speed data. If there is no data, I'd expect no graphs for that data and ideally it would be eliminated from the summary. I'm not certain that they will be eliminated, but it seems that it would be the right thing to do.

    Similar for calories. If there is no distance or heart rate data, I'd expect that the system would be unable to calculate the FirstBeat information (calories burned...).

    You might also tinker with the various sport/subSport values. Some functionality may be disabled based on the activity type.

  • Thank you for answer, I ll try to change other type of activites. For generic sport I have all data(speed, time in movement, distance) displayed even if there is no gps in my app.
    But to test it since it is on connectIQ I ll have to do release each time. Is there a way to avoid it ?
    thank you!

  • Did you solve the problem? I wanna add some personal lap fields in my app. 

    My procedure is just like yours but it doesn't work at all.

    lapCountField = mSession.createField("lapCountField", 7, FitContributor.DATA_TYPE_UINT32, {:mesgType => FitContributor.MESG_TYPE_LAP});
    <fitField id="7" displayInChart="false" displayInActivityLaps="true" sortOrder = "3"
    dataLabel="@Strings.jumpLapCountGraphLabel"
    unitLabel="@Strings.jumpLapCountGraphLabelUnit" />
    I do set data for this field and then add a new lap, but finally nothing was save into the lap data as personalized fields.

  • Yes, I did solve the problem but it was a really stupid mistake on my part. When you rotate the phone in landscape mode, you can scroll horizontally through the fields and there it should be. Well, at least it was for me I think (it's quite some time ago :-P ). If this is not the problem, I can share my code. Maybe that helps.

  • Can I disable the two native fields speed(km/h) and distance? My activity has nothing to do with these parameters

  • If there is no distance or heart rate data, I'd expect that the system would be unable to calculate the FirstBeat information (calories burned...).

    As said by Travis, it seems no way

  • As far as I know you cannot remove native fields. As writes, playing with sport and subsport may get rid of some of the unwanted data (being replaced wit other unwanted data ;-) ).