User application settings

For most wanted watchface feature - look into a new ObjectStore sample how to define default properies and setting options.

Here is a color configuration example:
<resources>

<properties>
<property id="PROP_COLOR" type="number">1</property>
</properties>

<strings>
<string id="title_color">Color</string>

<string id="opt_color_1">Blue</string>
<string id="opt_color_2">Red</string>
<string id="opt_color_3">Green</string>
</strings>

<settings>
<setting propertyKey="@Properties.PROP_COLOR" title="@Strings.title_color">
<settingConfig type="list">
<listEntry value="1">Rez.Strings.opt_color_1</listEntry>
<listEntry value="2">Rez.Strings.opt_color_2</listEntry>
<listEntry value="3">Rez.Strings.opt_color_3</listEntry>
</settingConfig>
</setting>
</settings>

</resources>


Please note that property must be a number if you can use the list of options.

Then, just load your property in the code, for example:

function onSettingsChanged() {
var color = App.getApp().getProperty("PROP_COLOR");
handleYourColorChangesHere(color);
Ui.requestUpdate();
}
  • You can cheat with side-loaded apps using the sim:

    • Side-load your app to your device and run it so it writes a settings with defaults
    • Connect your device to your computer via USB
    • Run your app in the sim
    • Open the App Settings Editor under the Connect IQ menu in Eclipse
    • Make whatever settings changes you need to make
    • Leave the simulator running, and navigate to
      • Windows: %TEMP%\Garmin\Apps\SETTINGS\
      • Mac: $TMPDIR/Garmin/Apps/Settings


    • Locate the settings file for your app
    • Copy the settings file to /GARMIN/APPS/SETTINGS on your device, replacing the default settings file


    This doesn't allow you to test the entire settings chain (GE/GCM), but it allows you to test settings on the device if you're primarily concerned with on-device app functionality.
  • In Eclipse you have to update the Connect IQ plugin.

    Under the Help menu, go to Check for Updates.
    Should list two Connect IQ related items.

    Once you have updated, you will find an App Settings Editor in the Connect IQ menu!


    Is there any means to do this NOT via the eclipse Plugin?
    Is the an alternative when one is using the windows command line?
  • Is there any means to do this NOT via the eclipse Plugin?
    Is the an alternative when one is using the windows command line?


    It's part of the Eclipse plugin, as it needs info from the eclipse project in the workspace (the .json in the bin directory for example, for user settings)
  • yup. I know that. What was missing was whether it's available (its obvious now it's not) for the command line version.

    For now, I've just been messing wit the TMPDIR and recompiling and deleting the SET file. It's getting old, so I'll likely follow suit and go the BETA app path. Certainly removes the need to plug and unplug the watch to the PC. But... Not sure if the contamt upload new version to the store is any better. Lol..
  • one more stupid question. Is there a need to do a SetProperty on a changed user settings value?
    I'm just dabbling in user settings and since one can't exactly test It properly hence the question.
  • one more stupid question. Is there a need to do a SetProperty on a changed user settings value?
    I'm just dabbling in user settings and since one can't exactly test It properly hence the question.


    No, you only getProperty().
    ConnectIQ saves the properties.
    It is as simple as that.
  • Cool. Thanks!!

    Also is itu imagination or based on. The few apps/datafields/watch I tried, the user settings page in GCM is unordered and haphazard? Like Z5 then Z2 then "enable custom zones" then Z3. It isn't ordered properly??
  • Cool. Thanks!!

    Also is itu imagination or based on. The few apps/datafields/watch I tried, the user settings page in GCM is unordered and haphazard? Like Z5 then Z2 then "enable custom zones" then Z3. It isn't ordered properly??



    Not your imagination. It is unordered for everybody.
    This has been reported before.
  • Cool. Thanks!!

    Also is itu imagination or based on. The few apps/datafields/watch I tried, the user settings page in GCM is unordered and haphazard? Like Z5 then Z2 then "enable custom zones" then Z3. It isn't ordered properly??


    That's a bug in GCM and has been reported to Garmin. The order looks to be proper when changing stuff with Garmin Express.
  • ah... Rarely connects the watch to the PC with BT sync nowadays.
    Anyways - my beta app got approved and managed to test out user settings. It works great(except for the unordered manner - I read thru all the pages in this thread and many others talking about user settings and didn't see it reported. Anyways. Thanks for confirmation)