Android Studio drawable folders

114,129

Solution 1

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.

Solution 2

Actually you have selected Android from the tab change it to project.

Steps

enter image description here

Then you will found all folders.

enter image description here

Solution 3

In order to create the drawable directory structure for different image densities, You need to:

  1. Right-click on the \res folder
  2. Select new > android resource directory
  3. In the New Resource Directory window, under Available qualifiers resource type section, select drawable.

  4. Add density and choose the appropriate size.

Solution 4

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

enter image description here

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.

Solution 5

Its little tricky in android studio there is no default folder for all screen size you need to create but with little trick.

  • when you paste your image into drawable folder a popup will appear to ask about directory
  • Add subfolder name after drawable like drawable-xxhdpi
  • I will suggest you to paste image with highest resolution it will auto detect for other size.. thats it next time when you will paste it will ask to you about directory

i cant post image here so if still having any problem. here is tutorial..

Drawable folder in android studio

Share:
114,129
user3397545
Author by

user3397545

Updated on July 05, 2022

Comments

  • user3397545
    user3397545 almost 2 years

    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.

  • user3397545
    user3397545 about 9 years
    I suppose I'll do this. I'm curious why the folders aren't there though when they should be there.
  • yole
    yole about 9 years
    Why exactly do you think they should be there?
  • Krupal Shah
    Krupal Shah about 9 years
    But hey what was the need to remove default folders? and changes like showing bar left side of braces are also have been changed. You guys are degrading the UI of Android Studio in each update.
  • mba12
    mba12 almost 9 years
    I'm new to Android as well and experiencing the same issue. It's really not a bit deal to create the subfolders but I found it a little disorienting while trying to follow a tutorial to have the default folders missing. Moreover, the tutorial instructions were to drag and drop images into the drawable folder in Android Studio and that didn't work either. Just so you know in the latest version of Android Studio the subfolders do not exist in Project mode either.
  • IshRoid
    IshRoid almost 9 years
    Just Write click on res folder after expanding folders, Then create new Directory, named it your desire DPI folder
  • codebased
    codebased almost 9 years
    would have been nice that what difference does it makes in Project vs Android selection. To me Android defines everything that means to apk. where as project is just an explorer. Overall I m happy I found the magic through you :)
  • NaveenThally
    NaveenThally almost 9 years
    i'm using Android Studio 1.2.1.1 i don't find the default folders even in project selection but have some folders like mipmap-hdpi,mipmap-ldpi etc
  • IshRoid
    IshRoid almost 9 years
  • Timothy Steele
    Timothy Steele over 8 years
    In "Supporting Multiple Screens", under "Using Configuration Qualifiers", Google explains you have to have to do it yourself, just as @yole explained. It's in the documentation.
  • ban-geoengineering
    ban-geoengineering over 8 years
    @yole Because they were there in Eclipse. Also, whilst it is understandable that separate folders exist for mipmap (as they are usually pre-populated with the launcher icons), not having separate folders when Android Studio creates the project does introduce an inconsistency - which many wouldn't expect or immediately understand.
  • Admin
    Admin over 8 years
    I have a question. I have put all the appropriate images in all the appropriate folders, but when I try to make an ImageView with the `android:src = "@drawable/myimg"/>, I get cannot resolve. Do I need the image to also be in the drawable folder as well as the sub folders? I have been stuck on this for the last 4 and a half hours, thanks for your help!
  • Admin
    Admin over 8 years
    I have a question. I have put all the appropriate images in all the appropriate folders, but when I try to make an ImageView with the `android:src = "@drawable/myimg"/>, I get cannot resolve. Do I need the image to also be in the drawable folder as well as the sub folders? I have been stuck on this for the last 4 and a half hours, thanks for your help!
  • Snake
    Snake almost 7 years
    If you put it in drawable then it means that it will not get resized
  • Admin
    Admin almost 7 years
    @user5562706 No, everything should work just fine. Try to clean your project. Cleaning works wonders. I hope it works for you.
  • Mohit Raval
    Mohit Raval over 6 years
    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.
  • john ktejik
    john ktejik over 5 years
    drawable isn't an option in my android studio 3.1.14
  • Mihir Trivedi
    Mihir Trivedi about 4 years
    What about post / pre API level?