skip to Main Content

I got the following images from design and I would like to add them to my Android Studio project. They are the same image for different sizes.

enter image description here

I remember I was able to drag and drop them into the file directory in AS and they will fall into the right folders. However, it’s now saying these folder already existing and I cannot drag and drop them.

My question: is there an easy way to import these images besides drag and drop each one individually?

2

Answers


  1. Ok then You may try this
    Copy the image from your local folder and right-click on the folder of the AS project you want to add the image and select paste.

    You can change the size at first you create that image.

    Login or Signup to reply.
  2. I understand your question and I will answer, but let us go a little deeper into this rationale. You need to create images for screens with different sizes.

    1 . SVG file :

    I suggest you use images in SVG format. They can work well on all screens.

    File > New > Vector asset

    2 . Use plugin ( Material Design Icon Generator ) :

    This plugin help you to set material icon in your app resources. Its also generate vector icons that work well on all screens . Here is page of this plugin :

    https://plugins.jetbrains.com/plugin/14170-material-design-icon-generator

    3 . Copy & Paste :

    Move your images to the following folders (create them if they do not exist):

    src/main/res/drawable
    src/main/res/drawable-hdpi
    src/main/res/drawable-mdpi
    src/main/res/drawable-xhdpi
    src/main/res/drawable-xxhdpi
    src/main/res/drawable-xxxhdpi
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search