What are the differences between the "drawable" folder and the "drawable-hdpi-ldpi-mdpi-xhdpi" folders?

To only have a "drawable" folder (if it doesn't exist I create) enough to generate a suitable image speed for all devices? or Should I create an image size for each folder (hdpi, mdpi, ldpi, xhdpi)?

+3


source to share


3 answers


res/drawable/

is equivalent res/drawable-mdpi/

. The suffix is ​​a smaller name for backward compatibility, before densities were added in Android 1.5 or so.

enough to generate suitable image speed for all devices?

If you don't mind Android scaling your images up and down for other densities, yes. Typically the quality will degrade if the density is from the starting point (in this case -mdpi

.



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

It depends on the image and the results of the automatic scaling. Many developers will supply a couple of densities, but not all of them, and aim for higher densities (eg -xhdpi

). But you can do what you want, as long as you think your users will be happy with the quality of the image you are delivering to them.

+3


source


You can have drawables with the same filename in different dawable - {} dpi folders. Outputs from corresponding folders are selected depending on the screen density.

You can read here



enter image description here

+3


source


Almost every application should have alternate resources for different screen densities, because almost every application has a launcher icon, and that icon should look good at all screen densities. Likewise, if you add other bitmap graphics to your application (for example, for menu icons or other graphics in your application), you must provide alternate versions or each for different densities. Take a look at this link: http://developer.android.com/guide/practices/screens_support.html

0


source







All Articles