Reputation: 723
I'm currently trying to support a larger range of devices with my Android app. However, even after reading through what the Android Dev Guide has to say on the issue, I'm unsure as to why I should provide different graphics for ldpi, mdpi and hdpi.
I understand that the images will automatically be scaled, so I can just supply hdpi graphics and let the device do the rest. Will the scaling quality be lower if the device does it? Will it be a performance issue? Right now I'm more worried about multiplying APK size by three.
Upvotes: 14
Views: 5008
Reputation: 16796
I can think of two reasons:
Upvotes: 5
Reputation: 11514
The reason for that is that if you want to show some thing in a hdpi device (higher pixel density per inch) you need more pixels to represent the same visual size.
You can let the OS scale the image but it will probably look blurry.
Upvotes: 0
Reputation: 134674
Will the scaling quality be lower if the device does it?
This is the one reason I would do it. For most images, I imagine the built in scaler will do just fine. However, most icons (launcher icon, notification icons) are going to be very pixel specific due to their small size. In those cases, making a smaller version manually will give you a sharper result than automatically scaling.
Upvotes: 0
Reputation: 20324
I would guess one have to make a balanced decision between performance and size. If you provide only a hdpi graphic, the OS would naturally have to use some resources on down-scaling it for lower-resolution devices. But if you provide both a hdpi, mdpi and ldpi graphic, it would require a bit more space.
However, your fear for multiplying the APK size by three isn't too important in my opinion. First of all, if you anyhow provide a hdpi graphic, adding an mdpi and ldpi graphic (which both are less than the hdpi graphic in size (there is approximately 3:4:6 scaling ratio)) will increase the size, but far from triple it (more close to double). Secondly, the graphics doesn't make up all of the APK size, so tripling the amount of images will not triple the APK size either. And finally: since Android now supports apps-to-SD, the size of your app isn't as crucial as it were in earlier versions.
Upvotes: 2