Storing app data on the watch

Hello all,

Struggling on finding the information for this in the API and examples.

I'm a Referee with some coding experience so I decided to build an app that would help me with time control for lacrosse games. both the basketball app and the soccer app are okay, but I've been messing around to make an app to help me with lacrosse specifically.

In the file structure, I noticed a folder that was "E:\GARMIN\APPS\SETTINGS" and one file *.set which had the same name as the soccer timer app. I love the fact the soccer timer app remembers the last time control. so I coded up a time control adjustment menu.

However, I usually ref 3-4 games a day on the weekend. so it would be nice if the time control is persistent between app resets. (the spring is high school which uses a different time control than, say, university)

I feel like I missed something in the API docs or the forums or i'm not searching for the right word. any guidance on how to leverage persistent settings in the Garmin watch app?

thanks
  • Ok, there are really two ways to store things. The file you see, the .set, is really the settings. Those are things that can change by either the app, or with "app settings" from a phone or with Garmin Express. (defined using the <property> tag in one of the xml)

    But there's also the .str file (in the apps\data directory) That's the actual object store. An apps own private space. (nothing in the xml is the difference). Something that's a bit confusing is they use the same api calls with properties.

    In an app where I want to do something like save the state when it exits, I put it in the .str, and next time it starts, read back the last state.

    In the sdk is the ObectStore sample. It actually shows both the .set and .str.

    The first screen is the .str stuff. You can change things in it using "File>Edit Object Store" in the sim (the apps own private data).

    The second screen, is the .set, and for that, you change things from Eclipse using "ConnectIQ>App Settings Editor"