Under Review
over 1 year ago

Feature-request: split the strings.xml for in-device and settings related strings

In most of the apps I've seen most of the strings are used for settings, still those strings are included in the memory footprint of the app. It would be very useful to split strings.xml to device-strings.xml and settings-strings.xml.

  • Each module scope variable takes 16 bytes in the data segment

    I misremembered this. It's actually only 8 bytes. The symbol is stored in 3 bytes, there's a flag byte (indicating data type amongst other things), and then 4 bytes for the value (which in this case is just a Number). So presumably the resource table uses 16 bytes per string. I guess it needs address, length, id, and something else?

  • No, unfortunately it doesn't work:

    ERROR: fr255s: resources/fitcontributions-base.xml:11: Fit contribution id=4's 'dataLabel' references non existent string ID 'fitMaxHeartRate'

    So there's still place for improvements, Garmin!

  • OH, coooool! I wonder if this always was possible and it was forgotten in the docs or they just added it recently. Anyway it works, I have now 300 bytes more to use.
    Next to try is to also add scope="settings" for all the strings that are only used in the fitContributions.xml 

  • good trick, probably I'll save less, because usually use

    var s = Rez.Strings;

    WatchUi.loadResource(s.myString).