0

Simple question. How does android work with drawable folders if any folders are empty ? Lets say I have images only in folder "drawable-hdpi". When I start application on emulator with higher dpi "drawable-xhdpi" it load images from "drawable-hdpi" (of course in bad size). Also when I start application on device with lower dpi "drawable-mdpi" it load images from "drawable-hdpi".

My question is - does it mean if doesn't exist images for current device dpi, android system takes images from other folder it is not empty ? Till today I thought, when images in current dpi are not present, application doesnt work.

mira
  • 1,056
  • 3
  • 15
  • 32

3 Answers3

1

It takes the near dpi, and scales the image up or down by the dpi difference between the target dpi and the folder dpi. If in the "drawale" folder (no dpi), no scaling takes place.

yoah
  • 7,180
  • 2
  • 30
  • 30
1

http://developer.android.com/training/basics/supporting-devices/screens.html

Note: Low-density (ldpi) resources aren’t always necessary. When you provide hdpi assets, the system scales them down by one half to properly fit ldpi screens.

evertvandenbruel
  • 1,133
  • 8
  • 13
0

It works. It first check in the current dpi folder for the resources. If not found then it use other available resources

stinepike
  • 54,068
  • 14
  • 92
  • 112