jungles/resources

Hi,

i cant figure out how to correctly use jungles in connect to resources.

For example i have vívoactive and fr235. I already have excludeannotations for some part of my code. But now i want to use different settings/properties.xml and settings/settings.xml
So i created file resources-fr235 where i have different settings/properties.xml and settings/settings.xml but when i run fr235 it still looks like i am compiling default resources.

In my jungle file i have:
fr235.resourcePath = $(fr235.resourcePath);resources-fr235

In resources-fr235 i have just folder settings with two files settings.xml and properties.xml.

For fr235 i want to remove option from properties for descended and climbed floors since fr235 does not support them.

Any help appreciated.
  • Try unchecking “Rebuild” in the app settings editor. Afaik, that triggers the default build, which has no target.
  • Try unchecking “Rebuild” in the app settings editor. Afaik, that triggers the default build, which has no target.


    Thats the think tricky :D! Thank you very much for help.
  • That's something I've never had checked, and never saw a reason to check it... Just run for the proper target then use the app settings editor to change things. It might be ok if you didn't use resource overrides or jungles in an app. (which can be the case in some apps)
  • Former Member
    Former Member over 5 years ago in reply to jim_m_58

    I'm experiencing a similar type of problem with the app settings editor, but I have not been able to solve it with the suggestions here so far.

    On my watch face, I have a boolean option in the settings file to show temperature which is pulled from the sensor history. I want to hide this setting for devices that cannot look at temperature sensor history.

    I created a separate resource directory for each incompatible device, named 'resources-qualifier', e.g., 'resources-approachs60'. In that directory, I have a settings directory with a settings.xml. The jungle file is unedited.

    When I run the app and then open the app settings editor (with Rebuild unchecked), it still shows the settings from the default 'resources' folder, not the custom settings for the device. I also noticed that the property values are not the default values, but it remembered the values that I changed during the previous run, even though the previous run was for a different device. In fact, I can close eclipse completely and open it back up and it still remembers the previous property values. It does not use the default values listed in the properties.xml file.

    I tried copying and pasting the properties.xml into the resources-approachs60/settings directory, but that did not work.

    I tried editing the default values in the resources/settings/properties.xml file, but that did not work. I still see the previous values.

    I can remove the temperature setting from the resources/settings/settings.xml file, and it disappears, but when I put it back, it still remembers the previous value; it does not use the default value in properties.xml. And it seems to ignore the resources-approachs60/settings/settings.xml file, which does not have the temperature setting listed.

    I also tried creating a directory with an arbitrary name, 'notemp-resources', and asking the jungle file to point to that for certain devices, but that did not work either. (This would be the ideal solution so I do not have lots of different resource directories and files for different devices.)

    No matter what, I keep getting the same settings in the app settings editor, and it remembers the values that I manually change. I can change those values, and they are immediately sent to the simulator per onUpdate(), but I cannot get it to read a different settings.xml.

    Any suggestions?

  • Former Member
    Former Member over 5 years ago in reply to Former Member

    I figured it out... I needed to have common settings in the default 'resources' folder and then add the temperature option in the override folder. Earlier I was doing it the other way around, where I was trying to use override to remove a setting. I did this because there are fewer devices that are incompatible with temperature sensor history, and it felt easier to make changes for fewer devices.

    I got it to work by having a single directory 'resources-temperature' and then using the jungle file to point certain devices to this folder. The properties.xml and settings.xml in this folder ONLY have the added temperature setting, and all other settings are in the xml files in the 'resources' folder.

    I was able to get to the bottom of it thanks to the Overview of Connect IQ Apps with Source Code page by peterdecker, and I looked at someone else's code which used resources override. This page also helped me get started in the first place; I had used a simpler watch face code from another user as an initial template (and credited at the bottom of my app description).

    Thanks a ton to you more experienced developers who are helping to spread the knowledge! It's much appreciated.