How do resources work?

Former Member
Former Member
Could someone please try to explain how I use the whole resources stuff to make a watch face for more than one watch? I have tried looking at the guide and also the sample but I don't understand it... Any help would be much appreciated! :)
  • Basically, you set up a structure like this for your project:



    "resourses" has the common things for all watches, and then the watch specific resource directories have the specifics for that watch. So you put things like layouts or bitmaps specific to the vivoacitive in it's directory, and those for the 230 in that directory...
  • Former Member
    Former Member over 9 years ago
    Basically, you set up a structure like this for your project:



    "resourses" has the common things for all watches, and then the watch specific resource directories have the specifics for that watch. So you put things like layouts or bitmaps specific to the vivoacitive in it's directory, and those for the 230 in that directory...

    So the main program for the watch still goes in the "source" folder?
  • Yes, the source is common for all watches, but it can use resources that differ by watch. So if you use layouts, that can be different based on the watch.


    In the code itself, you can use this like the width/height, as well as things like isTouch to adapt for different devices if you use dc calls and not layouts.
  • Former Member
    Former Member over 9 years ago
    Yes, the source is common for all watches, but it can use resources that differ by watch. So if you use layouts, that can be different based on the watch.


    In the code itself, you can use this like the width/height, as well as things like isTouch to adapt for different devices if you use dc calls and not layouts.
    Incidentally I ran a quick test a while ago. I was able to place source files in the specific resource folders. I seem to remember trying this a while back and it didn't work. I think this behavior has changed.
  • So, it is based on the folder names? it there a reference list for the folder names?

  • So, it is based on the folder names? it there a reference list for the folder names?

    It is based on resource folder names, and you can also hardcode your own custom folders in monkey.jungle (based on devices).

    [https://developer.garmin.com/connect-iq/core-topics/build-configuration/#devicefamilyandlocalizationqualifiers]

    If you want a "definitive" resource for all predefined resource folder names, you can refer to default.jungle in your SDK's bin/ folder.