Data Field settings

Former Member
Former Member
Hi,

I'm trying to create data field for my forerunner 920XT with settings that can be changed via Garmin Express or via Garmin Connect app.

I'm using SDK 1.2.4, I updated the Eclipse plugin to the latest and on the simulator when I do Edit Object Store I do see all properties.

In the App itself I also manage to retrieve them (using getProperty) but never see the option to change the settings (neither in Garmin Express nor in Garmin connect app).

Following is the App and the View, what do I miss?

Thanks,
Daniel

class TRIMPv2App extends App.AppBase {

function initialize() {
AppBase.initialize();
}

//! onStart() is called on application start up
function onStart() {
}

//! onStop() is called when your application is exiting
function onStop() {
}

//! Return the initial view of your application here
function getInitialView() {
var app = App.getApp();

var minHrr = app.getProperty("minHeartRate");
var maxHrr = app.getProperty("maxHeartRate");

return [ new TRIMPv2View(minHrr, maxHrr) ];
}

}


class TRIMPv2View extends Ui.SimpleDataField {

hidden var minHeartRate;
hidden var maxHeartRate;
hidden var HeartRateReserve;

//! Set the label of the data field here.
function initialize(minHrr, maxHrr) {
SimpleDataField.initialize();
label = "%Hrr";
minHeartRate = minHrr.toFloat();
maxHeartRate = maxHrr.toFloat();
HeartRateReserve = (maxHrr - minHrr).toFloat();
}

//! The given info object contains all the current workout
//! information. Calculate a value and return it in this method.
function compute(info) {
// See Activity.Info in the documentation for available information.

if (info.elapsedTime == null) {
return ("---");
}
if (info.currentHeartRate == null) {
return ("No HR");
}
if (info.currentHeartRate < minHeartRate) {
return ("HR too low");
}

var pHRr = (info.currentHeartRate.toFloat() - minHeartRate)/HeartRateReserve;
return (pHRr);
}

}
  • You are not doing anything wrong. Currently, you can only edit the settings in Garmin Connect Mobile/Garmin Express for published apps. For unpublished apps, you can use the settings editor to generate a settings file, and then copy the settings file over to the device to verify it is working.

    It is not ideal, but the Garmin guys know it is an issue and I'm sure have plans to improve the situation.

    Travis
  • Additionally, you may be interested to know that the user's resting heart rate can be retrieved from Toybox.UserProfile.getProfile().restingHeartRate. If you want a rough estimate of max, you can calculate it from the user's birth year (which is in the same structure).

    Travis
  • With the latest Eclipse plugin and the simulator, to edit your settings, you use the "App Settings Editor" in the Connect IQ menu of Eclipse.

    The "Edit Object Store" in the simulator shows the Object Store (a .STR file) and the settings (a .SET file), and really doesn't do much with the .set data. The "app setting editor" use a .json file generated when you compile (it's in the \bin dir)

    You should be able to use this to check out how your settings work in the simulator but can't test changing settings on a real device until it's in the app store.
  • Former Member
    Former Member over 9 years ago
    May i ask, are there plans to fix this?

    In other words: I code up a data field for myself and side load it over to my 235 using Eclipse. Then connect the watch to my iPhone via BT, and using the GC mobile app i can select the data field settings that i've coded and change them. Just like data fields/apps/watch faces/widgets downloaded from the store ... ?

    Thanks.
  • People have asked for the ability to test app-settings with side loads, and Garmin as also talked about having something like a "test/beta" mode for things in the app store, to allow app-settings be tested before something is available to everyone, but I've heard no dates or timeframes.

    One of the things with app settings, is that there's a file needed on GCM/GE that's not on the watch, but comes from the app-store.

    It's basically the "<myprogram>-settings.json" file that you'll see in the bin directory when you build a project, and it controls things like what's configurable, that value's type, range, etc. That file is how with Eclipse you can do app settings, and would be needed on GCM or GE for configuring a side-load.
  • Former Member
    Former Member over 9 years ago
    Might be off topic a little

    Hi -

    When I read this support.garmin.com/.../case.faces it says I should be able to enter these manually. When I add my indoor row, distance is important but I can only enter in the connect dashboard online. Any idea why I can't do this in the connect iOS app? There seems to be no option for distance on iOS mobile garmin connect. Thanks!
  • May i ask, are there plans to fix this?

    In other words: I code up a data field for myself and side load it over to my 235 using Eclipse. Then connect the watch to my iPhone via BT, and using the GC mobile app i can select the data field settings that i've coded and change them. Just like data fields/apps/watch faces/widgets downloaded from the store ... ?

    Thanks.


    People have asked for the ability to test app-settings with side loads, and Garmin as also talked about having something like a "test/beta" mode for things in the app store, to allow app-settings be tested before something is available to everyone, but I've heard no dates or timeframes.

    One of the things with app settings, is that there's a file needed on GCM/GE that's not on the watch, but comes from the app-store.

    It's basically the "<myprogram>-settings.json" file that you'll see in the bin directory when you build a project, and it controls things like what's configurable, that value's type, range, etc. That file is how with Eclipse you can do app settings, and would be needed on GCM or GE for configuring a side-load.


    App settings were designed with the app store as a dependency, so when an app is side loaded, you're essentially sidestepping that dependency. For general app testing, side loading is fine, but of course it breaks app settings. By enabling a beta mode on the store, like Jim mentioned, we'd keep the app store in the loop and allow you to test app settings as they would be used by customers.

    I don't have a timeline for the addition of this kind of feature to the store, but it is something we have planned.
  • This is still unfixed after 7 years Slight smile

  • Thanks for the update. While still being a workaround, this would fix my issue.

    On-device settings doesn't seem to work for my sideloaded app, even though I've updated the SDK version to be 4.1.