So for example in the string resource file of the resources-fenix5 folder, you would have the following:
<strings>
<string id="DeviceName">Fenix 5</string>
</strings>
Today I had some time to replace that implementation with a better approach: jungle and excludeAnnotations.
It is a better approach because the value is compiled into the source and not determined at runtime by loading a string resource.
It improves performance and memory usage.
In a class, duplicate the same property for each corresponding device that you support, and give each one a relevant annotation:
class MyDevice {
(:approachs60)
const DeviceName = "Approach S60";
(:d2charlie)
const DeviceName = "D2 Charlie";
(:descentmk1)
const DeviceName = "Descent Mk1";
(:fenix5)
const DeviceName = "Fenix 5";
}
In your jungle file you just set the list of excludeAnnotations for each device:
approachs60.excludeAnnotations = d2charlie;descentmk1;fenix5
d2charlie.excludeAnnotations = approachs60;descentmk1;fenix5
descentmk1.excludeAnnotations = approachs60;d2charlie;fenix5
fenix5.excludeAnnotations = approachs60;d2charlie;descentmk1