Skip to content Skip to sidebar Skip to footer

What If Image Is Not Found In Drawable-ldpi?

I have one image that is in all folder except drawable-ldpi folder. Then if i will run my project in ldpi devices then from which folder it will try to find that image? or my app w

Solution 1:

Test case i performed using mdpi device --

  1. Placed image in drawable-xxxhdpi folder only, worked fine.
  2. Placed image in drawable-ldpi folder only, worked fine.

Came to conclusion it perform both scale up and scale down

Regards


Solution 2:

It is not required to have images for all the densities, only one is enough. The system will scale it up/down when needed. So the best approach is to have images for the highest density supported (xhdpi or xxhdpi).

It will scale but you might run into problems when a phone with a ldpi tries to load xhdpi or xxhdpi images.

Google's recommended that it is useful when you are creating different images for each resolution and not just resizing it.

And also in present when Eclipse creates launcher icons, it only creates them for mdpi, hdpi, xhdpi, and xxhdpi. Based on that creating ldpi icon is not necessary and that mdpi will be scaled down automatically.

In your case it will try to find image in mdpi folder.


Solution 3:

Dont worry, FYI ldpi device is closed before some months and now no any new ldpi device will come in market. But if any user will install your app in ldpi device then it will find closest image as compare to ldpi and will show it.

But that image must be in any of the folder.


Solution 4:

If the user is using a device with a low density screen, and a ldpi resource is not found, the resource with the closest density is used and scaled down.

By the way, I wouldn't even bother with mdpi, let alone ldpi.


Solution 5:

Your app will not crash until you have the named image in at least one of drawable folders. System will show the closest density image.


Post a Comment for "What If Image Is Not Found In Drawable-ldpi?"