Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What happens if I leave all of my images in the drawable-hdpi folder?

I have all of my images in the drawable-hdpi folder. And I finished all of my layouts for all screen sizes. But i forgot to put the images in the drawable-mdpi folder and drawable-ldpi folder. If a phone with an mdpi screen density were to download my application would it just use the images in the drawable-hdpi folder? Or would an error occur because there are no images in the mdpi folder?

The only images in the mdpi and ldpi folder is the icon.

like image 659
user861040 Avatar asked Jul 25 '11 07:07

user861040


People also ask

What does the drawable folder contains?

A drawable resource is a general concept for a graphic that can be drawn to the screen and which you can retrieve with APIs such as getDrawable(int) or apply to another XML resource with attributes such as android:drawable and android:icon . There are several different types of drawables: Bitmap File.

What is drawable folder in Android directory?

In Android Studio inside the res folder, one can find the drawable folder, layout folder, mipmap folder, values folder, etc. Among them, the drawable folder contains the different types of images used for the development of the application.


2 Answers

The phone is gonna take the images from where they're available. The result will be the same than if you had only a "drawable" folder, it is just not a logical name if you have only one drawable folder.

You are not forced to provide resources for every configuration, the system just take care of using the most adapted and is clever enough to do that job. You should read that to fully understand how it works : http://developer.android.com/guide/topics/resources/providing-resources.html#BestMatch

like image 145
Lyrkan Avatar answered Sep 28 '22 09:09

Lyrkan


Lyrkan is mostly correct. Mdpi phones will take the image from the drawable-hdpi folder. But the system knows that those images are too big for the phone and scale them down for you.

Most of your users won't notice. The only problem is that on phones with mdpi or ldpi screens all the images will get a little bit blurry because they are scaled down on the fly to match the other screen resolution.

like image 29
Janusz Avatar answered Sep 28 '22 10:09

Janusz