5

If I add a large image to xxxhdpi folder does it gets resized automatically by Android to smaller images for other screen resolutions?

And if yes from which version of Android is this supported?

Mario
  • 13,941
  • 20
  • 54
  • 110
  • 1
    I would read up on http://developer.android.com/guide/practices/screens_support.html but long story short, if it only finds one instance of the Bitmap it will scale it, but it will first search for a correct representation of the bitmap (in the corresponding folder). I am pretty sure xxxhdpi was introduced for use in 4.4 due to Nexus 5 issues, but either way that is a huge resolution to be using, I would back it up to xhdpi unless you have a real reason for it. – zgc7009 Jul 08 '14 at 20:07
  • It does do some auto converting if you only supply one in that folder. Android Asset Studio can provide some conversions for some iconography and a few others. – Jay Snayder Jul 08 '14 at 20:07

3 Answers3

4

You shouldn't really need xxxhdpi. It was only introduced because of the way that launcher icons are scaled on the Nexus 5's launcher.

So throw your image into xxhdpi and it will scale down for other devices. The only issue you'll have is quality. You'd get higher quality out of the image if you scale it yourself.

Max McKinney
  • 1,218
  • 15
  • 25
  • 1
    the problema is that saving an image at 6 different resolutions is very time consuming, especially if you have to save 20-30 images at different sizes and times 6. – Mario Jul 08 '14 at 22:11
  • 1
    in the documentation you can see this explained : Note: The mipmap-xxxhdpi qualifier is only needed to provide a launcher icon that may appear larger than normal on an xxhdpi device. You do not need to provide xxxhdpi resources for all the images in your app. https://developer.android.com/guide/practices/screens_support.html?hl=es-419 – David Hackro Jul 26 '17 at 17:05
2

Adding to my comment, this is from Android Developers - Supporting Multiple Screens.

Provide different bitmap drawables for different screen densities By default, Android scales your bitmap drawables (.png, .jpg, and .gif files) and Nine-Patch drawables (.9.png files) so that they render at the appropriate physical size on each device. For example, if your application provides bitmap drawables only for the baseline, medium screen density (mdpi), then the system scales them up when on a high-density screen, and scales them down when on a low-density screen. This scaling can cause artifacts in the bitmaps. To ensure your bitmaps look their best, you should include alternative versions at different resolutions for different screen densities.

And from a Roman Nurik post

I talk about some of the key aspects of Android 4.4 KitKat that all Android designers should be aware of. Specifically:...
7) The introduction of new XXXHDPI (640dpi) launcher icon assets due to the Nexus 5 launcher's icon scaling behavior.

So it seems that it will scale, and that the resolution xxxhdpi is a newer implementation. I really would avoid using xxxhdpi images in an application unless you plan on using them specifically and for a good reason as they are going to be large files.

Edit It does seem xxxhdpi was introduced in 4.3, as stated in this Android Police Article. Either way, it hasn't been around for long and isn't used by many devices at this point, so I still say that unless you have an explicit reason to use a xxxhdpi image it isn't worth the space and scaling issues you might encounter by using it.

zgc7009
  • 3,371
  • 5
  • 22
  • 34
  • 2
    a single large image is not that large compared to 6 other different resolutions of the same image. Not to mention how much it takes to save each image at different resolutions (calculated) – Mario Jul 08 '14 at 22:09
  • @Mario M just use one at xhdpi and even mdpi unless it needs to be high res for a reason, will still be smaller than xxxhdpi. And scaling a single large xxxhdpi to a small scale may give undersired results. – zgc7009 Jul 08 '14 at 23:27
1

It was first spotted in the 4.3 source (see Android Police) and its distribution is currently less than 0.1% (see Screen Sizes and Densities). Although the images would scale down you should include lower resolutions (I would go with mdpi, hdpi and xhdpi without xxxhdpi) to ensure both high image quality and high performance.

  • I have a samsung note 10.1 with 2560x1600 resolution, I must make my apps look good on this device too. – Mario Jul 08 '14 at 22:12