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.
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:
- In Android Studio, open an Android app project.
- In the Project window, select the Android view.
- Right-click the res folder and select New > Vector Asset.
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!
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
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.
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
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.
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.