I've been having a lot of issues trying to get the GPS to be disabled in my Gym Set/Timer app.
Despite
1) Asking explicitly for GPS and disabling it
2) NOT asking for GPS
both of the above will STILL turn on GPS.
I then tried other means..
I initially tot that it's because of my SUB_SPORT / SPORT that I was selecting - but didn't look that way, then I tried to change an existing program that was not using recording session and altered it to be a recording session. Wah lah!!..
I took the example from the SDK - TIMER
//!
//! Copyright 2015 by Garmin Ltd. or its subsidiaries.
//! Subject to Garmin SDK License Agreement and Wearables
//! Application Developer Agreement.
//!
using Toybox.WatchUi as Ui;
using Toybox.Graphics as Gfx;
using Toybox.Timer as Timer;
//////////////////////////// ADDED ////////////////////////
using Toybox.ActivityRecording as Record;
//////////////////////////// ADDED ////////////////////////
var timer1;
var timer2;
var timer3;
var count1 = 0;
var count2 = 0;
var count3 = 0;
//////////////////////////// ADDED ////////////////////////
var session;
//////////////////////////// ADDED ////////////////////////
class MyWatchView extends Ui.View
{
function callback1()
{
count1 += 1;
Ui.requestUpdate();
}
function callback2()
{
count2 += 1;
Ui.requestUpdate();
}
function callback3()
{
count3 += 1;
Ui.requestUpdate();
}
function onLayout(dc)
{
timer1 = new Timer.Timer();
timer2 = new Timer.Timer();
timer3 = new Timer.Timer();
timer1.start( method(:callback1), 500, true );
timer2.start( method(:callback2), 1000, true );
timer3.start( method(:callback3), 2000, true );
}
function onUpdate(dc)
{
var string;
//////////////////////////// ADDED ////////////////////////
if ( ( session == null ) || ( session.isRecording() == false ) ) {
session = Record.createSession({:name=>"Strength", :sport=>Record.SPORT_GENERIC, :subSport=>Record.SUB_SPORT_STRENGTH_TRAINING});
session.start();
}
//////////////////////////// ADDED ////////////////////////
dc.setColor( Gfx.COLOR_BLACK, Gfx.COLOR_BLACK );
dc.clear();
dc.setColor( Gfx.COLOR_WHITE, Gfx.COLOR_TRANSPARENT );
string = "Count: " + count1;
dc.drawText( 40, (dc.getHeight() / 2) - 30, Gfx.FONT_MEDIUM, string, Gfx.TEXT_JUSTIFY_LEFT );
string = "Count: " + count2;
dc.drawText( 40, (dc.getHeight() / 2), Gfx.FONT_MEDIUM, string, Gfx.TEXT_JUSTIFY_LEFT );
string = "Count: " + count3;
dc.drawText( 40, (dc.getHeight() / 2) + 30, Gfx.FONT_MEDIUM, string, Gfx.TEXT_JUSTIFY_LEFT );
}
}
class InputDelegate extends Ui.BehaviorDelegate
{
function onMenu()
{
timer1.stop();
}
}
and in the manifest file I added the request for FIT File Permission
<!-- This is a generated file. It is highly recommended that you DO NOT edit this file. -->
<iq:manifest xmlns:iq="www.garmin.com/.../connectiq" version="1">
<iq:application entry="MyApp" id="DA90CADD868440BE82D1C65E3942BDAB" launcherIcon="LauncherIcon" name="AppName" type="watch-app">
<iq:products>
<iq:product id="square_watch"/>
<iq:product id="round_watch"/>
</iq:products>
<iq:permissions>
<iq:uses-permission id="Fit"/>
</iq:permissions>
<iq:languages>
</iq:languages>
</iq:application>
</iq:manifest>
i compiled the program, installed it and then ran the one w/ and w/o the Recording session.
when i LONG Press the DOWN key, I will get to the digital clock, on the digital clock face, on the
1) w/o recording session - i do NOT see the words GPS
2) w/ the recording session - I see the words GPS
I'm running this on an F3 on FW 4.0 CIQ 11.3
Please help to verify if the behaviour is intended (which I'm guessing it's NOT)