Abid
Abid

Reputation: 279

Multiple MDPI/HDPI drawables with different for same

I am new to android and this concept of multiple resources is killing me and its Halloween =)

Ok so for Normal screen we have following HDPI per http://developer.android.com/guide/practices/screens_support.html#range

WVGA800 (480x800) WVGA854 (480x854) 600x1024

so my image will go in drawable-hdpi. should image be 480x800, 480x854, 600x1024, or all 3 in the drawable-hdpi?

If all 3 are doing to be in drawable-hdpi, how I will name them? They can't have same names.

Thank you in advance

Upvotes: 0

Views: 1369

Answers (1)

blessanm86
blessanm86

Reputation: 31789

The common drawable folders are drawable-hdpi,drawable-mdpi,drawable-ldpi.

These folders are used to tell android which set of image to use on different situations. The different names that can be used are given here.

When a small ldpi phone is being used and it tries to refer an image named icon.png. It first refers the drawable-ldpi folder. If it doesn't find it there, it moves to the other folders till it finds the image. But if the phone was an hdpi device, android would first look into the drawable-hdpi folder. So if icon should be of different sizes, you put the different sized image in each folder with the same name. And android will decide which folder to access the image in run time.

This might be a bit confusing in the beginning but you will get used to it after a while.

Upvotes: 1

Related Questions