Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Drawable folders in res folder?

What is the difference between the three drawable folders in the res folder in the project hierarchy? If I have an image to put into a folder, which folder do I put it in?

like image 500
Mohit Deshpande Avatar asked Mar 28 '10 15:03

Mohit Deshpande


People also ask

How many drawable folders are available in the res folder?

why there are 2 drawable folder in res folder in android? - Stack Overflow.

What folder is drawable folder in?

If you have a drawable resource defined in XML that is independent of pixel dentity (e.g. a Shape Drawable) you should place it in drawable. Show activity on this post. Under android Right click on the drawable (under folder " res ").

How do I make a drawable Xxhdpi folder?

Simply go to project Explorer and change your View from Android to project from drop Down and you are good to go. There you can simply create folder like we do in Eclipse. And in android project view it is hidden but when you switch to project. You can create folder like drawable-hdpi,drawable-xhdpi .

Why there are different drawable folders in android?

1) The reason behind the different drawable folders - to enhance user experience when using our app, by accomodating each device's screen density.


1 Answers

I am going to take a guess that "the three drawable folders" are drawable-ldpi, drawable-mdpi, and drawable-hdpi. In that case, if you stick with all of those folders, you need to put one image in each, sized to match the indicated screen density. This is discussed in the online documentation as well as this blog post. You can find a set of sample projects showing use of different drawable resources based on screen density here.

If you are just starting out in Android development, you can get rid of all three of those directories and create a single drawable directory, putting your image in there. Eventually, though, for a quality application, you will want to test your images on different devices/emulators with different screen densities, and possibly have different images for each density to improve the look of your app.

like image 174
CommonsWare Avatar answered Sep 26 '22 00:09

CommonsWare