In Android Studio, I can't figure out where to put images to be used inside the app. The drawable folder isn't broken down into drawable-hdpi, drawable-ldpi, etc. I saw another question asking this and the answer was to switch to Project view instead of Android view but drawable is only one folder there too. There is mipmap-hdpi, mipmap-ldpi, etc, but people are saying that's only for app icons. I'm confused.
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.
1. What are Drawables? A Drawable resource is a general concept for a graphic which can be drawn. The simplest case is a graphical file (bitmap), which would be represented in Android via a BitmapDrawable class. Every Drawable is stored as individual files in one of the res/drawable folders.
No, Android does not allow subfolders under /res/drawable : Can the Android drawable directory contain subdirectories? You can however, add all image files under /drawable and then access them programmatically via: int drawableID = context. getResources().
Actually you have selected Android from the tab change it to project.
Steps
Then you will found all folders.
If you don't see a drawable folder for the DPI that you need, you can create it yourself. There's nothing magical about it; it's just a folder which needs to have the correct name.
In order to create the drawable directory structure for different image densities, You need to:
\res
foldernew >
android resource directory
In the New Resource Directory
window, under Available qualifiers
resource type section, select drawable
.
Add density and choose the appropriate size.
In Android Studio 1.2.1.1
Just copy the image and paste the image into the app > res > drawable folder and it will shows you "Choose Destination Directory" popup screen as shown below screen
Now you can select option whatever resolution you want to place and if you want to view the those image into the folders then simply right click on the drawable folder > select copy paths option and open it. It will help you.
Its little tricky in android studio there is no default folder for all screen size you need to create but with little trick.
i cant post image here so if still having any problem. here is tutorial..
Drawable folder in android studio
There are two cases:
If you are having a single image, irrespective of device version, then you should put your images in drawable folder.
But for the images that you created separately for hdpi, ldpi, mdpi, xhdpi, xxhdpi and xxxhdpi, depending on screen resolution of the mobile that will be using the app, you have to puy them in drawable-hdpi, drawable-ldpi, drawable-mdpi, drawable-xhdpi, drawable-xxhdpi and drawable-xxxhdpi folders respectively.
For the first case, if there is a single image, you can pretty much place it in any drawable folder, but its standard convention to put them in drawable folder.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With