views:

770

answers:

1

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?

+3  A: 

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.

CommonsWare
You don't NEED to put an image in each; the platform will pick the image that best matches the device's density, and it it isn't exact scale it to match.Also for applications targeting 1.6 or later, it is strongly recommended that you put your bitmaps in a directory that matches its designed density (it makes no sense to have a bitmap without a density specification); of course non-bitmaps like the various XML drawables generally have no such need and should be in the plain directory.See also: http://developer.android.com/guide/topics/resources/resources-i18n.html#AlternateResources
hackbod