14

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.

alain.janinm
  • 19,951
  • 10
  • 65
  • 112
forneo
  • 715
  • 2
  • 8
  • 13
  • You think the os can scale and resize images without just stretching them? You think it's always OK to just have your images stretched up to twice its size? – Falmarri Nov 27 '10 at 17:51
  • 4
    No, I'm thinking of having them scaled down, not up. – forneo Nov 27 '10 at 17:53

4 Answers4

5

I can think of two reasons:

  1. Developer concern: Putting all icon versions in your package consumes space and bandwidth, scaling them on the fly consumes CPU. No prize for guessing which one is cheaper on a mobile device. (I suspect though that applications on the Android market will only download the applicable resources - in which case your users aren't even paying the space/bandwidth tax) Reference needed.
  2. A designer concern: when you scale down an icon manually, you can (and a devoted designer will insist to) redesign the icon in order to get crisper results than automatic scaling. Look at this page for a detailed explanation of why manually scaling icons is good. (He talks mainly about iPhone icons, but that applies to Android icons as well.)
Jean Hominal
  • 16,518
  • 5
  • 56
  • 90
  • Hi,I need help in this resolution wise images. can tell what image size/DPI does all three types takes. Me & My graphics designer tried out many combination but not succeeded yet. – Piyush Patel Nov 27 '10 at 17:09
  • My designer does feel bad about not scaling the graphics down herself (whether by making new graphics or by scaling them with Photoshop), so I guess I'll just go with three versions after all. The resolution issue is a bit more complicated though, I guess I'll bundle WVGA, WQVGA and whatever is the ratio equivalent for HVGA. – forneo Nov 27 '10 at 17:55
  • @piyushnp: You should be able to find that information on http://developer.android.com/guide/practices/ui_guidelines/icon_design.html – Jean Hominal Nov 27 '10 at 18:20
  • *"I suspect though that applications on the Android market will only download the applicable resources"* If this is the case, it is a very clever feature! But do you have anything to back up what you say? You only upload a single APK-file to the market, so do you think they somehow drill into that and remove different resources based on which device it is downloaded to? I'm just asking out of curiosity :) – Julian Nov 28 '10 at 11:24
  • Well, I had read somewhere that when you downloaded on the Android market, you didn't download the APK directly, so that it was harder for a user to get a hold of your downloaded app. I thought that if that was true, it wouldn't take a lot of effort for Google to make changes so that one doesn't download the resources he doesn't need. But I haven't been able to find a confirmation for one thing or another - so I have stricken it through. Don't have the time to look at that now... – Jean Hominal Nov 28 '10 at 11:49
  • ^^ This is absolutely not true. How do you think android APK's are pirated? when you download the app, you download the APP. If you don't believe, try creating a free app, post it, then copy the downloaded apk to another device and run it. bam. it runs. – Evan R. Sep 18 '12 at 19:46
  • "I suspect though that applications on the Android market will only download the applicable resources" this is just possible in the recently released Android App Bundle https://medium.com/google-developer-experts/exploring-the-android-app-bundle-ca16846fa3d7 – 5argon Oct 31 '18 at 04:01
2

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.

Julian
  • 20,008
  • 17
  • 77
  • 108
0

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.

Kevin Coppock
  • 133,643
  • 45
  • 263
  • 274
0

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.

Pedro Loureiro
  • 11,436
  • 2
  • 31
  • 37