How to have 2 versions (16K, 32K) of resources including translations (eng, hun)?

I decided to remove some features from the devices that have only 16K DF memory to be able to squeeze it in the 16K. So after I removed (with annotations) part of the code I'd like to remove also the unnecessary properties and settings. So when in a device with only 16K the settings should only have the configs relevant to that device and also not include the strings that are only used in settings for devices with more memory. And I also would like to not repeat the same translation strings more than once (meaning I don't want to have the same entry: <string id="foo"> for a specific language in more than one place)

First I added a a new directory for source-memory32K and added it to monkey.jungle, and it works.

Then I added resource-memory32K and split the strings to 2 files: strings.xml: the phrases that are used in all devices, strings-memory32K.xm for the phrases that are only used in the settings of devices with at least 32K:

resources/strings.xml (foo:"Foo in English")
resources/strings-memory32K.xml (it's empty)
resources-memory32K/strings-memory32K.xml (bar:"Bar in English")

This works when I only have the default language. Then I added the translations:
resources-hun/strings.xml (foo:"Foo in Hungarian")

And now I'm stuck. Is there a pre-defined directory for the translations? I tried resources-memory32K-hun and resources-hun-memory32K, and neither of them is being used.

resources-memory32K-hun/strings-memory32K.xml (bar:"Bar in Hungarian")


How am I supposed to add it to monkey.jungle? This is my current file:

project.manifest = manifest.xml

base.sourcePath = source
base.excludeAnnotations = base

# Configure source paths for all supported devices
fenix3.sourcePath = $(fenix3.sourcePath);source-memory16K
fenix6.sourcePath = $(fenix6.sourcePath);source-memory32K

# Configure resource paths for all supported devices
fenix3.resourcePath = $(fenix3.resourcePath);resources-memory16K
fenix6.resourcePath = $(fenix6.resourcePath);resources-memory32K

# Configure exclusion annotations
fenix3.excludeAnnotations = $(fenix3.excludeAnnotations);memory32K
fenix6.excludeAnnotations = $(fenix6.excludeAnnotations);memory16K

  • At this point in time, if I was doing a new DF, I'd probably just skip supporting the CIQ 1 devices with only 16k.  I rarely hear from users of CIQ 1 devices any more though I have a number of apps with CIQ 1 device support..

  • Hehe, that might be a good practical answer, but even then the real (more general) question is if it's doable somehow without adding a huge matrix to monkey.jungle (multiplying the number of languages by the number of the variations)

  • You really just have two things.  16k or more than 16k, where in jungles you can use different source and resource folders.

    So I'd default to the more than 16k folders, and then add the 16k devices as exceptions.  So the jungle file and folders would be a bit simpler

    for strings and languages, you can probably get by with 1 xml per languages, as if you got a bunch of strings you don't use in the 16k version, you won't be loading them so it shouldn't really impact the runtime size.

  • Here for example is what I have in the jungles file for app settings, where many of the watches use the same settings, with the exception of the Instinct2/2s Only two lines and it takes care of a large number of devices.

    base.resourcePath=resources;resources-normal
    semioctagon.resourcePath=resources;resources-so

  • Have you looked at the strings sample in the SDK?  Resource overrides based on device, device family and language.  Jungles not involved.  That can get you started and then use jungles for things this doesn't handle.

  • That's more or less what I tried to do and I'm stuck at the "use the jungles for things it doesn't handle" :)

    The problem is this: If I add all translations to resources-hun/strings.xml, then even those that are not in resources/strings.xml are added and each of them takes up some 10 bytes in the memory map (even though there's no code and not even settings that can use them)