Hey, I have a lot of strings data, so I put them into Strings.xml..
The problem is that String.xml now is 5 mb big! So the .apk becomes big.. If I make on the first lunch of my app download the Strings.xml from a server, is it possible开发者_JAVA技巧 to replace a blank one that I put into the .apk with the one that I download after the app installation? Or is it bad to have the Strings.xml so big?Resources are read-only, so you can't replace them.
If you're not using the localization features (-en, -it, -de ...) and you can make your app download only the strings you need (provided you don't need always all of them), I would do that if it's worth it.
However, even if 5mb for a text file is a lot, I don't know if there are actual drawbacks, and in the end it will get compressed when in the apk.
Short answer: you can't replace a file which is embedded into the apk, also note that during the building stage, each xmls are converted into a binary representation. Since I don't know nothing about your app I can't tell if is bad to have a so big string.xml. maybe I'll take a look at the performance and at the memory consumption.
精彩评论