I’d like the ability to “overwrite” the Android resources packaged within my apk by having the app periodically download a zipped file containing overrides that follow the same naming convention as the source does. For example, the zip might consist of the following paths:
res/values/strings.json
res/values-land/strings.json
My code would parse those files and produce a Map> that would map the string resource id to a folder->value pair (or something along these lines). At this point I’m really only concerned with strings and images (maybe arrays), but not layouts, etc.
To the point: Is there any method available, that, given a list of folder names, would tell me which one the Android resolver would choose based on current state? I’m assuming this is difficult because the compiler breaks everything down to ids, but figured it was worth a shot. Any ideas?
No. You are welcome to roll this yourself based on
Configuration,DeviceMetrics, and kin. You will also need to create your own parsers for your own files, as Android’s resource system only works with resources, not arbitrary files retrieved from arbitrary locations.The expectation in Android is that if you want to update resources, you update the app, probably because there were also code changes as well. Admittedly, this approach has its limitations.