Utku Soytaş
Utku Soytaş

Reputation: 1495

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) ?

Upvotes: 4

Views: 4789

Answers (3)

sschrass
sschrass

Reputation: 7166

You can have drawables with the same filename in the different dawable-{}dpi folders. Depending on the display density the drawables from the correpsonding folders are picked.

You can read up here

enter image description here

Upvotes: 3

CommonsWare
CommonsWare

Reputation: 1006664

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.

Upvotes: 5

Jossy Paul
Jossy Paul

Reputation: 1287

Almost every application should have alternative drawable resources for different screen densities, because almost every application has a launcher icon and that icon should look good on all screen densities. Likewise, if you include other bitmap drawables in your application (such as for menu icons or other graphics in your application), you should provide alternative versions or each one, for different densities. Have a look at this link: http://developer.android.com/guide/practices/screens_support.html

Upvotes: 0

Related Questions