I've recently released a DataField which aims to support quite a wide array of device layouts. After playing with different ways of defining the layout differences between screen sizes, I settled on a solution of using JSON resources - nice and elegant - then went to support the Forerunner 235 with it's 1.X SDK that doesn't support JSON resources. So I resorted to defining string resources, all of which are integers, and converting them to toInt() on initialization. I have about 7 different layout.xml files in resource folders containing my layout variables defined as strings, and whilst this technique absolutely does work, it is obviously not the proper way to describe a layout; it is (a) smelly because it is a perversion of the intended use of string resources, (b) causing build warnings about strings being defined multiple times for the same language and (c) probably not optimally efficient since it is performing an unnecessary type conversion and storing both the string keys and values in memory as well as the converted integers.
I figured I'd try creating several Layout.mc files instead and declare simple global variables in each, then get the the jungle to include the right one at build time. If that's what jungles are supposed to do, I can't figure out how to make it work. Depending on where I put the files I either get build errors because the variables are defined multiple times or not at all.
Anyway, rather than describing the solution I want, I'll describe the problem and ask if anyone can provide a memory-efficient solution that is better than using string resources. I have about 15 integer values that need to be different for each screen size. I need to retrieve those values once, at startup. I want the retrieval of those values to be as memory efficient as possible, and preferably, I'd like the place where they are defined to allow for either comments or descriptive variable names that make their intention clear without creating unwanted memory bloat.
If anyone can point me in the right direction I'd be very grateful.