i have made game app library can incorporate variety of "wrapper" projects, each own manifest file. can maintain variety of different versions e.g. free, paid, alternative markets etc.
i wanted each wrapper able affect value of various boolean flags include_adverts
or allow_feature_x
. thought way (correct me if dumb idea) each wrapper project have own set of strings defined in own strings.xml. have things like:
<string name="allow_feature_x">true</string>
but have problem scooping these strings within library.
i tried this:
boolean allow_feature_x = my_str2bool(getstring(r.string.allow_feature_x));
but allow_feature_x cannot resolve error. can strings.xml thing made work? or scheme fundamentally flawed start?
this many of projects.
just make sure library project has default set of strings defined in it, otherwise won't able reference them, since library not know "parent".
then override them in "parent" projects. need override ones different default, otherwise take value library project.
hope makes sense.
edit: way can reference booleans so:
<bool name="allow_feature_x">true</bool>
and access getresources().getboolean(r.bool.allow_feature_x);
Comments
Post a Comment