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