Entry: Mounting SDCard in ANDROID Friday, January 25, 2008



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/

   0 comments

Leave a Comment:

Name


Homepage (optional)


Comments