I have an app that is localized in 24 languages.
When I build the app with English-only resources, the app is 1.6MB.
When I build the app with all languages resources, the app is 2.5MB.
Language-dependent resources are a couple of HTML files, and strings.xml.
Since the app is running a background service, it is annoying to get it killed due to memory pressure. It seems to be more frequent when it is 2.5MB than when it is only 1.6MB.
Therefore I want to decrease the app size by avoiding to ship all languages in the APK when only one is really needed.
I’m considering making an APK with almost English only and the possibility for the user to download language files from the app at runtime.
Are there frameworks for doing this in Android, or maybe at least patterns or best practices?
Any suggestion is warmly welcome.
You wouldn’t see memory issues due to the size of your APK. This would only effect the ability to install the app on a device if the user doesn’t have enough space to install it. I think you probably have a different memory issue that you are incorrectly blaming for your memory issues (did a little deeper to see if you can correct the issue).
You can use Proguard to eliminate resources from your final APK, but I don’t think this is a wise approach. Link: http://developer.android.com/tools/help/proguard.html
I also think it is not a good idea to create separate APKs for each language (and in fact, this is against the terms of service for the Play Market).
Bottom line, check your app again, and fix your memory issues – you are likely going down the wrong path trying to blame your problems on your localized resources.