-1

What to type in the src box to add an image into an app in android?

I was developing my first app and wanted to add images. I double clicked the image button on the screen of the mobile and src box showed up. I know I can not fill the box with url directly. What should I fill in?

1 Answers1

0

Put the images in your Drawable folder (lowercase name), for example image.png Then in the XML you can write android:src="@drawable/image"

Hespen
  • 1,384
  • 2
  • 17
  • 27
  • where is the drawable folder? I can see million drawable folders and I think I am wrong. Which drawable folder should I use? – Prathyusha Pillari Jan 02 '15 at 13:37
  • You can see here: http://developer.android.com/guide/practices/screens_support.html what drawable folder belongs to which screen size. You should create an image for each screen size. If you do not have the correct size for a screen, android will automatically rescale your image, which may cause a decreased image quality. So put the correct image size in the correct folder, or just put 1 image in one folder. – Hespen Jan 02 '15 at 13:41
  • If this was the answer you were looking for, please accept it. So this case can be closed. – Hespen Jan 02 '15 at 22:05