I'm seeing sort of a weird(?) behaviour on an app I'm writing.
Weird #1
When I StopSession, i expect it to discard the session. But it seems like sometimes I honors it, most times it does not. I still see the session still being saved (from the watch's history page)
Shouldn't it NOT be in the history page?
Weird #2
sometimes, when i stop the app, and supposedly it will discard the session. When I immediately (or couple secs) go to a native app (RUN App for instance), it will show me a Save/Discard/Trackback etc view. The top will read something like 0:00 / _:__ km
I will go and do the "discard" and the watch will just hang there w/ the circling discard animation. (I have to Hard reboot the watch via the LIGHT/POWER Button)
Is there a native Save / Resume / Discard view that we can leverage whenever we stop a recording session?
BTW - for clarification (not entirely clear to me in the manual/API doc)
session.save == we stop and save the session
session.stop == we stop the session (not saving the fit file? or does it save it?)
session.discard == we stop and discard the session. (we do not need to explicitly do a session.stop(); session.discard();)
function StartSession(dc) {
var SS_Start = Sys.getTimer();
if ( session == null ) {
Sys.print("Session CREATE & START");
session = Record.createSession({:name=>"Running", :sport=>Record.SPORT_RUNNING, :subSport=>Record.SUB_SPORT_STREET});
session.start();
} else if( (session != null) && (session.isRecording() == false) ) {
Sys.print("Session RESTART");
session.start();
} else if( session != null && session.isRecording() ) {
Sys.print("Session STOP (PAUSE)");
session.stop();
}
var SS_End = Sys.getTimer();
var SS_Total = SS_End - SS_Start;
Sys.println(" StartSession Total Time: " + SS_Total);
Ui.requestUpdate();
}
function StopSession(dc) {
if( session != null && session.isRecording() ) {
Sys.println("Session STOP & SAVE");
// session.stop();
//session.save();
session.discard();
session = null;
Ui.requestUpdate();
}
}