Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android xxxhdpi drawable resolution auto resize

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?

like image 718
Mario Avatar asked Jul 08 '14 19:07

Mario


3 Answers

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.

like image 160
Max McKinney Avatar answered Nov 19 '22 22:11

Max McKinney


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.

like image 27
zgc7009 Avatar answered Nov 19 '22 21:11

zgc7009


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.

like image 1
Arpad Baksa Avatar answered Nov 19 '22 20:11

Arpad Baksa