The information in this blog may be injurious to health


Friday, January 25, 2008
Mounting SDCard in ANDROID

Here is an small tutorial on how to mount teh SDCard in the Android emulator with out which it wont play or record any files.
i hope this could help a bit for

Note: we will use ~/android as our path for google android sdk and ~/myandroid as our path for other things
1. Go to your google android sdk path
cd ~/android/tools

2. Create an image of an sdcard (2Gb)
mksdcard 2147483648 ~/myandroid/sdcard.img

3. Mount the image to a loop device
sudo losetup /dev/loop0 ~/myandroid/sdcard.img
(source: http://www.osdev.org/osfaq2/index.php/Disk%20Images%20Under%20Linux)

4. Make a folder where you want to mount the image
mkdir ~/myandroid/sdcard

5. Mount the loop device into a folder so that you can put things directly unto it (as long your root)
sudo mount /dev/loop0 ~/myandroid/sdcard

6. Open the folder using root account
Alt+F2
gksudo nautilus ~/myandroid/sdcard

Now you can drag any files to this folder (Remember your using your root account so be careful of deleting anything)

Finally to load this sdcard in your emulator
emulator -sdcard ~/myandroid/sdcard.img
or if your using eclipse modify your configuration
Run >Run > >Emulator >Addition Emulator …..
-sdcard ~/myandroid/sdcard.img

To get files from this card just use /sdcard in your program (This takes me 2 hours to figure out)

Note: When you put things in ~/myandroid/sdcard you have to kill the emulator and reopen it again to see your files

Ref :http://monmonja.com/blog/2007/11/sdcard-on-google-android/

Posted at 12:41 pm by Vishnu

 

Leave a Comment:

Name


Homepage (optional)


Comments







Previous Entry Home Next Entry


   





<< January 2008 >>
Sun Mon Tue Wed Thu Fri Sat
 01 02 03 04 05
06 07 08 09 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31






Contact Me

If you want to be updated on this weblog Enter your email here:




rss feed