Multiple Data Fields : How to ?

Former Member
Former Member
Hi,
I'm a new developer on Connect IQ, and my goal is to create a new multiple data field (not an app ) , as what is done in Single Field (https://apps.garmin.com/en-US/apps/640d46dd-12db-44d2-acfa-cb7eb9e840b7 ) , but with my specifics fields.

but when I read the doc on garmin, and I search in the forum, I see that there is only the SimpleDataField that we can extend.

On this class, there is only one field that we can update, then we can have only one field updated (in the compute(info) method ).

I wanted to draw the lines to separate the fields, and make different compute for having my fields updated (really like in Single Field ).

But I don't find how to do it.

Please help !!

Rgds,
  • If you use Eclipse, go to "file>new>Connect iq project", and select "data field" as the type. You're then given the option for simple or complex. Pick complex.

    That gives you a the template for a complex data field. With it, there is 'onUpdate()" where you as the developer draw the contents any way you want. You don't return the value from compute().

    compute() gets called every second, even if the DF isn't shown on the current screen, so save/calculate what you want there. onUpdate() gets called once a second, but only when the df is visible, so generally only is used to display the data gathered/calculated in compute()
  • Former Member
    Former Member
    I used complex, but this seems not worked as I wanted ...
    Maybe because I'm too newby :)

    Thanks a lot; I'll have a look on both.

    Rgds;