SimpleDataField with Companion App/Widget

Former Member
Former Member
I am new to writing apps for the garmin. So I am still learning, hopefully the below will make sense.

I want to create a data field to use under the "Run" garmin application on my vivoactive. I have done a simple one and it works fine, but at this stage I have hardwired two variables in code. For now that is ok, but I would like to be able to change them without building and transferring across each time.

What I would like to be able to do is store/retrieve a couple of variables from an Object Store.

My understanding is that each AppBase as an object store. I have created a separate application that can store two variables in it's object store. So I ca do that.

So my question is, is there anyway that my datafield can access the object store of my separate application? If not, is there an alternate way of achieving what I want? Basically be able to store two variables on the watch and retrieve them from different Apps / Datafield / Widgets?
  • No, this is not possible. As far as I can tell, every application/widget/data field/watch face has its own data store, and each of them are sandboxed so they cannot be accessed by others.

    The folks at Garmin have said that they will be providing a way to set object store properties via the Garmin Connect Mobile app. If this works the way I think it is supposed to, you could expose a property for your data field, and then use your mobile device to change the value of that property. You'd need to change the setting for each application/widget/data field/watch face independently, but you do have some control
  • Former Member
    Former Member
    No, this is not possible. As far as I can tell, every application/widget/data field/watch face has its own data store, and each of them are sandboxed so they cannot be accessed by others.

    The folks at Garmin have said that they will be providing a way to set object store properties via the Garmin Connect Mobile app. If this works the way I think it is supposed to, you could expose a property for your data field, and then use your mobile device to change the value of that property. You'd need to change the setting for each application/widget/data field/watch face independently, but you do have some control


    Ok, that would be fine. Hopefully that will happen soon. :-)

    I thought my datafield was working last night, but I tried to use it today on a runand it just showed an IQ with a ! in it.. I assume that means some kind of error. Works fine in the simulator, so not sure what is going on exactly. Will just have to play around till I can get something that works on the device I guess.
  • Former Member
    Former Member
    No, this is not possible. As far as I can tell, every application/widget/data field/watch face has its own data store, and each of them are sandboxed so they cannot be accessed by others.

    The folks at Garmin have said that they will be providing a way to set object store properties via the Garmin Connect Mobile app. If this works the way I think it is supposed to, you could expose a property for your data field, and then use your mobile device to change the value of that property. You'd need to change the setting for each application/widget/data field/watch face independently, but you do have some control


    Garmin guys, do you know when/if the above feature would be available? Being able to change the Object Store for a datafield via connect mobile app??
  • I don't have a specific timeline for this feature, but it's one of the higher priority items that we're working on. What complicates this particular feature is that it involves multiple teams to coordinate their pieces (e.g. Connect IQ, device teams, Garmin Connect, Garmin Connect Mobile, etc.). If this were something that we could just implement in Connect IQ and release, it would be much simpler and probably be something we could offer much sooner.
  • If this were something that we could just implement in Connect IQ and release, it would be much simpler and probably be something we could offer much sooner.


    Then the ability to share properties between multiple apps, widgets and data fields would have fitted the bill :cool:
  • I'll file a request to add the ability to share properties between apps and see where it goes. I have a feeling that this will be considered as part of the app settings features that were discussed above, but it's worth consideration.
  • I'll file a request to add the ability to share properties between apps and see where it goes. I have a feeling that this will be considered as part of the app settings features that were discussed above, but it's worth consideration.


    Consider the following use case:

    We cannot access web based services from data fields so in order to get around this, we should allow a user to "cache" the relevant information before the activity. And the type of data goes way beyond what you would manually enter - e.g. fuel predictions, elevation profile and weather predictions.
  • Yeah, that case definitely makes sense. We currently don't have to worry about stored values with the same key since the object store is sandboxed for each app. If we open up the object store to be shared across apps, though, we'd need to have a way to designate which apps can access a particular value, or avoid collisions from duplicate key names from unrelated apps. That's our problem, of course, but it's one reason why we can't just open up the object store to every app.

    I've added your example case to the ticket, though. Thanks for your comments!
  • Yeah, that case definitely makes sense. We currently don't have to worry about stored values with the same key since the object store is sandboxed for each app. If we open up the object store to be shared across apps, though, we'd need to have a way to designate which apps can access a particular value, or avoid collisions from duplicate key names from unrelated apps. That's our problem, of course, but it's one reason why we can't just open up the object store to every app.


    One possible solution is to add another UUID to manifest.xml - e.g.

    <iq:application entry="App" id="01234567890123456789" storageId="01234567890123456789" launcherIcon="LauncherIcon" name="AppName" type="datafield">
    ....
    </iq:application>


    That way the developer can control which applications that should share storage...
  • Former Member
    Former Member
    Also, one more thing with SimpleDataField. Am i correct in assuming there is currently anyway that we can use these in our own Apps? ie, I have made one that I am using in the standard "Run" app from garmin and it works great, is there anyway I can access the label/value from an application I am making myself. Just so I don't have to duplicate code, or I can use a simpledatafield that someone else has created. etc.. Is this likely to be ever available?