79

I can save all my images directly in the res/drawable-xxx folder.

But how can I import/copy images to my project from Android Studio?

If I drag an drop my images from the Finder (MacOS), the files only move to the res folder.

At in the context-menu there is no Import... and under New... there is also not.

nbro
  • 15,395
  • 32
  • 113
  • 196
webschnecke
  • 919
  • 1
  • 8
  • 21
  • 1
    Drag-and-drop to the relevant directory works fine. – etienne May 21 '13 at 12:24
  • AS= Android-Studio :-) , but drag & drop just move in MacOS not copy :-( – webschnecke May 21 '13 at 13:03
  • 7
    Why not use copy-paste shortcuts? Using Cmd+C in Finder and in AS Cmd+V for the file you want to import – Priebe Jun 04 '13 at 09:30
  • 2
    For android studio, Use this plugin https://github.com/winterDroid/android-drawable-importer-intellij-plugin – Kishan Vaghela Mar 05 '15 at 06:40
  • Copy paste works absolutely fine in my case , i was not able to drag and drop the image file so I copy pasted. Works – TaraGurung Mar 06 '15 at 08:47
  • Use this link to get an idea . https://www.youtube.com/watch?v=Dvf_wjQPl48 – Saneesh Oct 14 '17 at 05:46
  • Copy file in windows and secondary/paste works like a charm (Using Android Studio 3.X.X). It just adds *.png and in addition creates the XML dependencies needed – Ignacio Ara Apr 25 '18 at 09:40
  • I made a tool here so you can select the images with the highest resolution and it will resize and copy to all your drawable folders: https://github.com/datmt/Copy-And-Resize-Drawable-Images-X-DPI/ – Dũng Trần Trung Sep 11 '18 at 02:08

9 Answers9

87
  1. Go to your image in windows, then press ctrl + c OR Right click and Copy

  2. Go to Your res Folder And choose One of the folders(eg. MDPI, HDPI..) and press ctrl + v OR right click it and Paste

Graham Borland
  • 60,055
  • 21
  • 138
  • 179
Michael A.
  • 1,011
  • 6
  • 9
  • 6
    Does it make any difference which folder I select? I am struggling to find any documentation about the "New Image asset" command. The first question concerns the 'destination directory'... What a mess they did. – Antonio Sesto Feb 09 '15 at 16:54
  • 3
    Works for OS X this way as well - while dragging shows a drop-spot, but does nothing on button release. – brainray Dec 22 '15 at 12:59
48

Goto Settings > Plugin > Browse Repository > Serach Android Drawable Import

This plugin consists of 4 main features.

  • AndroidIcons Drawable Import
  • Material Icons Drawable Import
  • Scaled Drawable
  • Multisource-Drawable

Edit : After Android Studios 1.5 android support Vector Asset Studio.


Follow this, which says:

To start Vector Asset Studio:

  1. In Android Studio, open an Android app project.
  2. In the Project window, select the Android view.
  3. Right-click the res folder and select New > Vector Asset.

enter image description here

Kishan Vaghela
  • 7,678
  • 5
  • 42
  • 67
6
  1. go to your image in windows and copy it
  2. go to the res folder and select one of the drawable folders and paste the image in there
  3. click on imageview then go to properties and scroll down until you see src
  4. insert this into src @drawable/imagename
user3314574
  • 85
  • 3
  • 9
4

If you want to do this easily from within Android Studio then on the left side, right above your file directory you will see a dropdown with options on how to view your files like:

Project, Android, and Packages, plus a list of Scopes.

If you are on Android it makes it hard to see when you add new folders or assets to your project - BUT if you change the dropdown to PROJECT then the file directory will match the file system on your computer, then go to:

app > src > main > res

From here you can find the conventional Eclipse type files like drawable/drawable-hdpi/drawable-mdpi and so on where you can easily drag and drop files into or import into and instantly see them. As soon as you see your files here they will be available when going to assign image src's and so on.

Good luck Android Warriors in a strange new world!

Chris Klingler
  • 5,258
  • 2
  • 37
  • 43
3

For Mac + Android Studio 2.1, I found the best way is to save the image and then copy (cmd + c) the image file in Finder and then click on the the drawable directory and cmd + v to paste in that directory. Copying the image directly from a website using cmd + c (or right click then copy) doesn't seem to work.

bigtex777
  • 1,150
  • 10
  • 15
2

To import files from OS X Finder into Android Studio, just drag the relevant files to your resource folder.

  • Drag & Drop by default moves files to your project (not what you always want)
  • Pressing ⎇ (Alt) while dragging copies files

Don't find a permanent config option for this, but this is the workaround I'm using

Diego Freniche
  • 5,225
  • 3
  • 32
  • 45
2

For Android Studio:

Right click on res, new Image Asset

Select the image radio button in 3rd option i.e Asset Type

Select the path of the image and click next and then finish

All the images are added to the respective folder, its very simple

Patrick
  • 61
  • 6
0

You can simply use the terminal that comes with Android Studio. It is listed at the bottom of Android Studio. Just open it and use the cp command.

J0e3gan
  • 8,740
  • 10
  • 53
  • 80
shivtej
  • 633
  • 9
  • 18
  • how is this please explain – Basheer AL-MOMANI Mar 16 '16 at 15:12
  • Click on **Terminal** written on the bottom of Android Studio and then use it like normal linux terminal. You can use `cp` as `cp path/to/image yourproject/app/src/main/res/`. Not sure about other operating systems but this works in linux. – shivtej Mar 16 '16 at 19:45
0

I'm in Mac OSX as well and in a new project I need to:

  • Right click on res folder in the project and add a new Android resource directory.
  • Select drawable from the drop down and Accept.
  • Copy and paste the image into the drawable folder.

Disclaimer : This does NOT cover different resolutions etc.

AMAN77
  • 6,218
  • 9
  • 45
  • 60