71

I am completely new with Android/Eclipse. I can't figure out how to add an image in the /res/drawable folder of my Android Eclipse project.

P.T.
  • 24,557
  • 7
  • 64
  • 95
toto_tata
  • 14,526
  • 27
  • 108
  • 198

12 Answers12

118

Copy the image CTRL + C then in Eclipse select drawable folder, right click -> Paste

user2988879
  • 379
  • 2
  • 6
  • 18
Nikola Despotoski
  • 49,966
  • 15
  • 119
  • 148
  • 1
    Thanks, it works... The drag and drop didn't work so that I though that copy/paste didn't work either! – toto_tata Jul 22 '11 at 20:25
28

Drop in the image in /res/drawable folder. Then in Eclipse Menu, do ->Project -> Clean. This will do a clean build if set to build automatically.

omermuhammed
  • 7,365
  • 4
  • 27
  • 40
10

Just copy the image and paste into Eclipse in the res/drawable directory. Note that the image name should be in lowercase, otherwise it will end up with an error.

MC Emperor
  • 22,334
  • 15
  • 80
  • 130
Sachin Surjan
  • 169
  • 2
  • 2
  • 1
    Also, be careful that the image name is not a keyword, like do or for. – Bill - K5WL Apr 29 '14 at 21:02
  • It also appears that it does not like hyphens. I had fbc-logo.png and it would throw an error on paste. renamed to fbclogo.png and good to go. – kyle Jun 14 '14 at 21:03
6

Right click on drawable folder_new_file- click on advanced button_ link to file in the file system_ then click on browse. finish

R3z4
  • 69
  • 1
  • 1
3

You can just put it in on the file system. Eclipse will pick up the change on the next refresh. Click the folder and press F5 to refresh. BTW, make sure the file name does not have any capital letters... it will break android... and eclipse will let you know.

CrazyDart
  • 3,803
  • 2
  • 23
  • 29
2

Thanks for the information .It helped me out as my project was somehow not visible in workspace therefore I had to insert the image from ECLIPSE IDE. Also another way to do it is: The image to be inserted should be copied ctrl+c and then right click on the drawable folder and PASTE it. The image comes in drawable folder using ECLIPSE IDE. You can use the image as an icon of the application using Manifest File-android:icon="@drawable/image_name"

Bo Persson
  • 90,663
  • 31
  • 146
  • 203
0

When inserting an image into the drawable folders, another import point in addition to the "no capital letters" rule is that the image name cannot contain dashes or other special characters.

Zach H
  • 257
  • 1
  • 3
  • 15
0

Open folder path of Android application, open src folder then Add your image in /res/drawable folder

Ali
  • 1,265
  • 14
  • 18
0

For Android Studio:

  1. Right click on res, new Image Asset

  2. On Asset type choose Action Bar and Tab Icons

  3. Choose the image path

  4. Give your image a name in Resource name

  5. Next->Finish

The image will be saved in the /res/drawable folder!

Chris
  • 6,105
  • 6
  • 38
  • 55
0

Do you want to add an image from your computer? Just right click the folder in Eclipse and click Import

Pikaling
  • 8,282
  • 3
  • 27
  • 44
  • Yes, I want to import an image which is somewhere on my computer. The solution which works is a simple copy in the explorer and paste in eclipse. I didn't expect that it would work as the drag and drop directly in Eclipse didn't work! – toto_tata Jul 22 '11 at 20:27
-1

Try to use jpg and png , also name your image in lowercase. Then drag and drop the image in res/drawable . then go to file and click save all . close eclipse then reopen it again . That is what worked for me .

Humphrey
  • 2,659
  • 3
  • 28
  • 38
-1

You just need to copy/cut and paste the images into drawable folder using windows/mac file explorer

To refresh the workspace follow the steps mentioned in this question Eclipse: How do i refresh an entire workspace? F5 doesn't do it

If that does not work you might wanna restart eclispe

Community
  • 1
  • 1
Bercik
  • 139
  • 1
  • 14