I would like to be able to load the value of user-visible strings from res/values/strings.xml from our CMS (or some DB), during the gradle build.
E.g.
<string name="button_label">OK, do it</string>
Could be changed to
<string name="button_label">OK, do it now!</string>
... or whatever.
The idea being that the new value would be read AT BUILD TIME from our CMS, and then would get baked into the APK file. ( The motivation is to automate changes to app strings, so that any text from the app would be read from an existing CMS).
What's the best way to achieve this? Is it possible to generate/modify the resource files (e.g. strings.xml ) during build, just before they are used by the Android build system?
Adding some more requirements:
- The solution needs to support "Alternative Resources", aka overriding strings for other languages. (http://developer.android.com/guide/topics/resources/providing-resources.html#AlternativeResources)
- The solution should be able to override values that are in the original (default) strings.xml file.