1
votes

If I have an extra-high-quality image in the drawable-xhdpi folder and a medium-quality image with the same name in the drawable-mdpi, which of the two would a high density phone use?

Edit 1: Nanne's answer does not answer my question. His quoted passage relates to screen size whereas my question relates to screen density. I followed the link provided by Nanne (thanks Nanne) and did find this useful passage however:

"... you do not need default drawable resources when you provide alternative drawable resources with the screen density qualifier. Even without default drawable resources, Android can find the best match among the alternative screen densities and scale the bitmaps as necessary..."

But!! it just says (vaguely) Android will find the best match. Anyone know what that best match would be as per my question?

Edit 2: A bit of background on Nanne's request: I have a project to which I have added medium, high and extra-high density versions of images. My apk size is now ever so slightly over 20MB and I would like to keep it below 20MB. I would like to remove some images from either the mdpi, hdpi or xhdpi folder in a way that images still scale and look ok on all density phones, but am not sure which folder to remove some of the images from...

1
Can you add what problem you are trying to solve?Nanne

1 Answers

2
votes

From this page

When selecting resources based on the screen size qualifiers, the system will use resources designed for a screen smaller than the current screen if there are no resources that better match (for example, a large-size screen will use normal-size screen resources if necessary). However, if the only available resources are larger than the current screen, the system will not use them and your application will crash if no other resources match the device configuration (for example, if all layout resources are tagged with the xlarge qualifier, but the device is a normal-size screen).

So it should use the medium one.