How to add files like images inside your emulator in ANDROID?

In many of our android applications we need images and other files to be inside your emulator, such as images in the gallery. But unlike iPhone we cannot simply drag and drop files inside the emulator., because iPhone’s is simply a simulator. It justs creates an envoronment for testing. But ANDROID mimics the real phone. So we need to put files into the memory space inside the phone.
In this tutorial I will show you how to add files to the gallery of ANDROID emulator.
First you need to create an SD card for the emulator.
Second start the emulator with the created SD Card.

These two things are covered in this tutorial.
Third Open File Explorer from Window-> showViews and search for File-explorer.
You can see the File-explorer in the screnshot below.

See the Market portion on the right side of the window.
There are two buttons for pulling data out of the emulator and other for putting data into the emulator. Click on the “push a file on to the device”

Then you will be prompted with a dialogue(see above screenshot). choose the file from your computer and click Open. The selected file will be in your Emulator SD Card.

Now to see the file inside your emulator.
Either restart your phone or restart the emulator. If you put an image file then go to “Gallery” and you will see the pulled in file.

23 thoughts on “How to add files like images inside your emulator in ANDROID?

  1. Pingback: ANDROID - Upload an image to a server | Coderz Heaven

  2. Nabil

    Hey thanks for the valuable information…

    But i got a problem while uploading files into emulator like this

    “”"Failed to push selection: Read-only file system”"”………..

    Can anyone please resolve the above issue…

    Regardzzzzz……

    Reply
    1. James

      Maybe the folder in the SdCard you are trying to push your file into doesn’t have the write (w) permission. Under the File Explorer tab, find the Permissions column. What are the permissions there? Is your directory marked as d–rwxr-x?

      Reply
  3. Smita

    Hi,

    Thank for the information! I tried pushing file to sdcard but it says “Failed to push selection: Read-only file system” . I check the permission column and it shows “d———-”. How do I change the permission ?

    Reply
    1. James

      Hi Smita. Which SDK are you using. Is there a folder named /mnt in File explorer. Or a folder named /scard there , then push images only to /sdcard folder not /mnt folder.If you try to push to /mnt folder then you will get read-only file-system error. Please try this and let me know.

      Reply
  4. sam

    Hi,
    Nice post ,but there is another way to do,
    1.open the browser and google.com
    2.select the image search
    3.select the any one image from search
    4.then log press the on image,it will ask for save as
    5.the image will be downloaded in download folder.

    i have done it 2.3

    Thanks

    Reply
  5. Pingback: How to find a file size in KB in android? | Coderz Heaven

  6. hari

    hi,
    its very nice and easily understandable. but,
    while pushing data into sdcard it showing following error.

    [2011-08-29 14:45:52] Failed to push selection: Read-only file system
    please give the solution for this.
    Thanks in advance.

    Reply
  7. hari

    hi ,
    i tried to push images into sdcard folder but it showing following error

    [2011-08-29 15:18:18] Failed to push the item(s).
    [2011-08-29 15:18:18] (null)

    Reply
  8. khushbu

    i have selected sdcard folder and then push image.. but still same error..

    Failed to push the item(s).
    null

    Reply
  9. seema

    i have selected sdcard folder and then push image.. but i get the following error:

    [2014-03-09 17:00:56 - ddms] transfer error: Read-only file system
    [2014-03-09 17:00:56] Failed to push selection: Read-only file system

    the sdcard permissions show lrwxwxrwx

    plz help

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>