I had combed through a number of medium articles, the official Android documentation, and this thread to find ways to reduce the size of the hello world app generated by Android Studio. Unfortunately, the most common strategy, which is to enable Proguard to minify and shrink resources, hasn't done anything to reduce the size of the installed app. I'm also using the size of the app installed rather than the apk for my point of reference. And the size of the app generated comes out to a little over 5MB, which is over 5x more than what the person in the other thread cited. Any help would be much appreciated. I had tried installing this on a number of devices running KitKat, Lollipop and Nougat. I'm not sure if this is the cost of using a newer version of Android Studio (3.2.1) or newer tooling in general or if there are ways to optimize this code to bring this down to the size of Google Hangouts dialer, which is only 108KB (again, installed, not apk), even though it has considerably more assets and more functionality than a hello world app. Thanks.
Asked
Active
Viewed 114 times
0
-
2See: [How to measure Android app data size and identify storage leaks?](https://stackoverflow.com/q/35951332/295004) – Morrison Chang Nov 19 '18 at 03:26
-
Google Hangouts Dialer is a really bad example, since it just unlocks code that is already in the Hangouts app - it is nothing but a launcher icon essentially. – ianhanniballake Nov 19 '18 at 03:46
-
Morrison Chang: I ran the code from that thread and logged 11576 total bytes as the amount space used by my app in the /cache and /files folders. I'm not sure what kind of insight I can get from this information, especially actionable insight. ianhanniballake: although Google Hangouts Dialer can be described as nothing more than a launcher since it plugs into Google Hangouts, but perhaps we can agree that it does a whole lot more than the basic hello world app that comes with Android Studio? For another example, openvpn connect is 3.95MB installed. – Quilty Kim Nov 19 '18 at 03:55
-
1You will find that the bulk of your APK size -- which is all that you can control for a freshly-installed app -- is coming from libraries, notably `appcompat`. You would need to discontinue the use of those libraries and anything that depends upon those libraries. – CommonsWare Nov 19 '18 at 12:17
-
CommonsWare: thank you very much! Your tip led me to another thread that you helped with: https://stackoverflow.com/questions/31338881/how-to-stop-using-appcompat-in-android-studio and that brought the installed app size to around 200KB! – Quilty Kim Nov 19 '18 at 16:05