File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Android and the fly likes how to create sdcard and mount on the emulator Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Mobile » Android
Bookmark "how to create sdcard and mount on the emulator" Watch "how to create sdcard and mount on the emulator" New topic
Author

how to create sdcard and mount on the emulator

Suzzane Pinto
Ranch Hand

Joined: Feb 10, 2012
Posts: 213
hello friends,


i am trying to develop a simple application where i want to send an image from gallery to server.
i am facing problem in creating sd card into the emulator(version 2.1). it says no media found...
please let me know the steps for creating sdcard and pushing image to the sdcard.
Swastik Dey
Rancher

Joined: Jan 08, 2009
Posts: 1397
    
    6

When you create a new virtual device from eclipse, at that time there is an option to specify the size of sd card, and if you specify that it creates the sd card.


Swastik
Swastik Dey
Rancher

Joined: Jan 08, 2009
Posts: 1397
    
    6

See screen snaps.


[Thumbnail for new_avd.JPG]

Suzzane Pinto
Ranch Hand

Joined: Feb 10, 2012
Posts: 213
ya i got it....but how to see whethr sdcard is created or not and how to create a directory in the sdcard and save the image into it.
please help...



thankyou
Swastik Dey
Rancher

Joined: Jan 08, 2009
Posts: 1397
    
    6

Once the emulator starts, open command prompt and enter the following command. for e.g

c:\>adb shell

it opens the shell interface and promp changes to

#

not type ls, it will show the directory contents, and should show sdcard.

not type
#cd sdcard
the directory gets changed to sdcard
now type the following command
#mkdir nameofthedirectory/folder you wish to create

I hope this helps.

Suzzane Pinto
Ranch Hand

Joined: Feb 10, 2012
Posts: 213
yes i did that using DDMS perspective where i selected the emulator and did push operation..
now i am facing problem with with the transfer code after picking from gallery..
i have to transfer my image to server following is the code in andriod my main activity..please let me know




unable to understand the error
Swastik Dey
Rancher

Joined: Jan 08, 2009
Posts: 1397
    
    6

The following should show you the actual path of the image selected. Your next should be to read the file contents and send to server.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to create sdcard and mount on the emulator
 
Similar Threads
Create an image using j2me
out of memory exception when downloading image
where application is saved in android?
How to convert text to images
Capture image using android emulator