We have a localization module in our projects, We only maintain one default string folder, The localisation module keeps string value in dB for all the supported languages, and we have extended the Resource class.
@Override
public String getString(int id) throws NotFoundException {
String value = null;
try {
value = getStringFromRepository(id);
if (value != null) {
return value;
}
} catch (Exception ex) {
}
return super.getText(id).toString();
}
and keeps the LRU cache, and loads/sync from the Network in the app start-up when needed and when the language is changed. Network sync is done asynchronously on the background thread.
Load from cache and DB lookup is done on UI, It is giving ANRs.
I think they have probably done it to save on the initial app installation size.
The Android recommended and the simple way is to keep lang-wise string resources in the res folder. I want to know more, about how it internally manages and loads the correct string values to the texts, in order to reevaluate our existing implementations.