Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's differences between 'drawable' folder and 'drawable-hdpi-ldpi-mdpi-xhdpi' folders?

To have just 'drawable' folder(if doesn't exist, I create) is enough to create suitable image size rate for all devices? or Should I create image size rate for each folder(hdpi, mdpi, ldpi, xhdpi) ?

like image 509
Utku Soytaş Avatar asked Mar 19 '23 14:03

Utku Soytaş


1 Answers

res/drawable/ is equivalent to res/drawable-mdpi/. The suffix-less name is there for backwards compatibility, before the densities were added in Android 1.5 or thereabouts.

is enough to create suitable image size rate for all devices?

If you do not mind Android scaling your images up and down for other densities, yes. Usually, the quality will degrade the further the density is from the starting point (in this case, -mdpi.

Should I create image size rate for each folder(hdpi, mdpi, ldpi, xhdpi) ?

That depends on the image and the results of the automatic scaling. Many developers will ship a couple of densities, but not all of them, and tending to aim towards higher densities (e.g., -xhdpi). But, you are welcome to do what you want, so long as you feel that your users will be comfortable with the image quality that you deliver to them.

like image 138
CommonsWare Avatar answered Apr 09 '23 20:04

CommonsWare