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 Comments

  1. Alec March 28, 2011 at 8:28 am

    Nice blog post, neat site template, keep up the good work

     
  2. coder1 March 29, 2011 at 12:07 pm

    Thanks Alec.
    Thanks for the encouragement.

     
  3. New Balance April 2, 2011 at 5:35 pm

    I seriously knew about virtually all of this, but having said that, I still thought it had been helpful. Nice blog!

     
    • coder1 April 2, 2011 at 10:21 pm

      Thanks New Balance…..

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

  5. Nabil April 28, 2011 at 6:26 am

    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……

     
    • James April 28, 2011 at 1:02 pm

      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?

       
  6. ranganatha April 29, 2011 at 6:17 am

    Hi ,

    Thanks for giving crucial information in very understandable way

     
  7. Smita May 7, 2011 at 1:28 am

    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 ?

     
    • James May 7, 2011 at 8:23 am

      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.

       
  8. Credit Cards Consolidation June 12, 2011 at 1:59 pm

    I like this info shown and it has given me some sort of desire to succeed for some reason, so thanks.

     
  9. sam July 14, 2011 at 4:36 pm

    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

     
    • Soorya July 14, 2011 at 9:24 pm

      ya….good one……friend

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

  11. hari August 29, 2011 at 3:12 pm

    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.

     
    • James August 29, 2011 at 8:52 pm

      You are not pushing the file in the sdcard. select the folder and then push.

       
  12. hari August 29, 2011 at 3:19 pm

    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)

     
    • James August 29, 2011 at 8:52 pm

      I think you have not selected the sdcard folder before pushing file into it.

       
  13. Video Wall February 8, 2012 at 6:14 pm

    There are fantastic blog post which is post by you.

     
  14. khushbu June 19, 2012 at 11:07 am

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

    Failed to push the item(s).
    null

     
  15. seema March 9, 2014 at 11:34 am

    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

     
    • James March 22, 2014 at 4:48 pm

      Then its not the sdcard. check for mnt/sdcard and push the file.

       
  16. balasrilakshmi vaddi March 29, 2014 at 7:31 am

    hi very easy blog ur way of explanation is good.congrats you have done good job!

     

Leave a Reply

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

 

 

 

Theme by HermesThemes

Copyright © 2018 CoderzHeaven. All Rights Reserved

Please wait...

Subscribe to our newsletter

Want to be notified when our article is published? Enter your email address and name below to be the first to know.