source and .mc (may be jungles)

hi everyone,

so in order to save memory etc, I would like to recode one of my WF for 280x280 device,

so for the resource, it is ok with the ressource overriding, but what about the .mc with the OnUpdate?

I tried to understand the jungles but in vain...

could someone explain me how I can do ?

like if 280*280 use this .mc instead of

i thought about the app.base with returning an other view, but I don't think it will save memory.

many thanks

  • I don't know if this is the proper way of doing it, but for example I have a "normal" build and a "plus" build, and I have 2 jungle files setup in my project. Depending on which I want to build I switch between them (+ the manifest file) using the Project > Properties > Connect IQ menu:

    The monkey-normal.jungle file looks like this:

    project.manifest = manifest-normal.xml
    
    base.resourcePath = $(base.resourcePath);resources-normal
    
    base.excludeAnnotations = exclude;m1plus

    And the monkey-plus.jungle file looks like this:

    project.manifest = manifest-plus.xml
    
    base.resourcePath = $(base.resourcePath);resources-plus
    
    base.excludeAnnotations = exclude;m1normal

    These also cause each build to use different resource directories too for some things.

    In the source code you can then use annotations to include different functions for each build, by doing something like this (the monkey-normal.jungle excludes m1plus code, and vice versa):

    (:m1normal)
    function propertiesSetColor(p, v)
    {
    	applicationProperties.setValue(p, v);
    }
    
    (:m1plus)
    function propertiesSetColor(p, v)
    {
    	applicationProperties.setValue(p, (v>=0) ? v.toString() : "");
    }

  • excaclty what I need !!! Many many thanks!!!!

  • Hi, does the exclude works for. Xml ? Like settings, if I want add more colors for exemple ? 

  • I don't think you can use the "exclude" system.

    But in my setup above, the monkey-normal and monkey-plus jungle files specify extra resource directories where you can have different settings & properties files for the two different versions.

    So in my resources directory I have: drawables, fonts, jsonData subdirectories (no settings or strings)

    Then in resources-normal directory I have: settings and strings subdirectories (with settings/properties.xml, settings/settings.xml and strings/strings.xml)

    And resources-plus directory also has: settings and strings subdirectories (with almost exactly the same xml file contents but some changes as required).

  • OK many thanks, I get it, I mean I think I get it... 

    Is it possible to do what you ve done but only for 1 xml file ? Thé setting one, the only one where I will add may be 6 or 8 lines ? 

  • ok so, new questions (sorry I don't get very well Jungles...)

    so If I understand well, lets say I have this:

    +---resources
    lI------+---drawables

    lI------+---Fonts

    lI------+---layouts

    lI------+---settings

    lI------------II---properties.xml

    lI------------II---settings.xml

    lI------+---strings

    +---resources-fullcolor

    lI------+---settings

    lI------------II---settings.xml

    +---resources-rus

    ||----II---strings.xml

    if in the jungle I put:

    fenix6.resourcePath = $(fenix6.resourcePath);resources-fullcolor

    Does it will use the xml found in the
    resources-fullcolor and the others needed in the defaut resources folder?




    Other question about Languages, I use the string.xml to check an item and according to that I load the custom font needed in initialize
    but I've noticed that it seems to "pre load every font files.
    is it possible with jungle to do with language?
    if yes, please how?

    many thanks
    have a great day

  • Yep I think it should work for just the settings file (or whichever other one you want to change between versions)

  • I don't know the answer to your question about fenix6.resourcePath and overriding default resource files as I've never tried that method Slight smile

    I don't think font files can get preloaded automatically - I have 30+ different fonts so if they were all loaded they'd never fit! I load different font files depending on user settings using watchUI.loadResource and they only get loaded when loadResource is called.

  • Currently you cannot use font overrides in language resources.

    It is a limitation and a request for this was posted in the forums in the past.

  • Hi, thanks, I know about that, but my question is even with jungle ?