I was working on Android 1.5, but I have now moved to the latest version. So there is only one “drawable” folder in Android 1.5, but now there are three different folders for storing images in the Android project.
And I have found some articles for these three folders that says
- hdpi means High-dpi
- mdpi means medium-dpi
- ldpi means low-dpi
But what is the exact purpose of these three folders and when should I use a particular folder to store images in?
Supporting Multiple Screens (Android Developers) is a nice article about that. You’ll find more details on 1.5 support in the “Strategies for Legacy Apps” section.
To declare different layouts and bitmaps you’d like to use for the different screens, you must place these alternative resources in separate directories/folders.
This means that if you generate a
200x200 image for
xhdpi devices, you should generate the same resource in
Then, place the files in the appropriate drawable resource directory:
MyProject/ res/ drawable-xhdpi/ awesomeimage.png drawable-hdpi/ awesomeimage.png drawable-mdpi/ awesomeimage.png drawable-ldpi/ awesomeimage.png
Any time you reference
@drawable/awesomeimage, the system selects the appropriate bitmap based on the screen’s density.
I got one good solution. Here I have attached it as the image below. So try it. It may be helpful to you…!