Persistent Storage / App.Setproperty - where is data stored?

hi -

I'm making changes to my GymTimer app and I would like to add a persistent userDefined rest time. (Currently the default is 60s) . While the rest time can be user defined via a menu option - this user defined option does not carry forward for the next time the app is ran.

I understand that I can use app.setproperty() and app.getproperty() to do the persistent storage, but I'm a little unsure of how it's used.
The Setproperty/getproperty seems to be a key/value pair which is fine. I believe I can use it.
What I would like to know is how does the code store this data.

Is it stored under GARMIN\APPS\DATA?
As a FIT file?

I searched github and the ObjectStore example but can't connect the dots (yet)
  • Former Member
    Former Member over 9 years ago
    Yes, the VM calls save properties when the app exits. If you never exit the app, the object store would not get written out. On the simulator, you should be able to trigger this behavior by selecting File->Kill App.
  • So, the only way to save an OS from a watchface is by using saveProperties().

    Will an OS have to exists for "user configuration", as it seems that users are asking for variations of watchfaces that "user config" should handle.
  • Former Member
    Former Member over 9 years ago
    I'm not sure if you are experiencing a bug or if we are still not on the same page.

    Watchfaces close when you leave them just like any other app type. If they change something in their object store while running, it should get saved and written out when they exit.

    The applications settings feature that is coming will add items that can be configured externally (by GCM or Express) to the object store.

    I can't think of many reasons for a watchface to modify the object store itself since there is no user interation, but if it does, it should save.
  • Watchfaces close when you leave them just like any other app type. If they change something in their object store while running, it should get saved and written out when they exit.


    When does a watchface close? Seems if you switch to a watchface, and then connect to USB, I don't see the auto save under that case. Would it only save if I swipe to a widget or move to the app screen? Again, this might be moot if an OS doesn't have to exist before it can be "user configured" in the future. That's the only reason I'm trying to save it in a watchface.
  • Former Member
    Former Member over 9 years ago
    The watchface should close just about any time it isn't visible. If you have a watchface that writes out to the object store, and you don't see it get created when you attach to USB, but do if you exit the watchface and then attach to USB, then there is probably a device issue. (Let me know how to reproduce the store not appearing for a watchface if this is the case.)

    The settings configuration will be part of the object store when accessed from ConnectIQ, but won't interface directly through the object store file, so it shouldn't affect that.
  • On, on a va with 2.90. watchface with only the direct call to saveProperties() comment out.

    1) sideload .prg, and after watchface displays, reconnect usb.
    -no .str file created
    2) from watchface, swipe to widgets or enter app menu
    -no .str file created
    3) go to settings and switch to a different watchface
    -no .str file created

    I can't think of any other way to exit a watchface. Seems none of them will save the object store. Seems the ONLY way to create an OS from a watchface is by calling saveProperties.
  • Former Member
    Former Member over 9 years ago
    I've been informed that the VM is not currently saving properties when watchfaces exit. This was an oversight, but the rework of the object store backend appears to have fixed the issue, so the next release will correct it.