Question

When you include icons for multiple screen sizes in your Android application are the icons that don't apply to that screen size purged when the application is installed on a device? For example, if I have a tablet that has an xlarge screen that has a xhdpi density are the icons in the drawable-ldpi, drawable-mdpi and drawable-xhdpi folders purged when the application is installed (assuming drawable-xhdpi has all the necessary icons)?

Was it helpful?

Solution

Yes. All resources in will be included in the apk. The apk is the installed application; there's no point at which the resources are copied elsewhere before running it. You can confirm this by installing your app on a Nexus 10, then using adb to make it emulate other dpi targets. Even though you've installed the apk when the device was at a xxhdpi, relaunching it at mdpi doesn't kick off another install, the mdpi resources are already there.

A solid strategy for reducing the size is to simply not use large images when they're not necessary. I use conservative 9-patches and substitute xml drawables for shapes when appropriate. If you've done everything you can and you're still concerned with the apk size, you can create multiple apks that target different dpi points.

OTHER TIPS

It has to have one of each of those icons in the apk. So it will increase the size.

Yes it will but you can use programs like OptiPng to compress your PNG Images so the size of the application wouldn't be affected much.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top