Sdcard on google android
Posted on November 17th, 2007 in Technology, android |
This is a tutorial on how to emulate a sdcard on google android. This tutorial is a bit advance and is done in Ubuntu. I hope this can help android developers and fasten up your development.
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 >
-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
Remember me when you guys won, lol.













7 Responses
Sdcard on google android…
0
vote
This is a tutorial on how to emulate a sdcard on google android. This tutorial is a bit advance and is done in Ubuntu. I hope this can help android developers and fasten up your development….
thanks. it is helpful
p.s. i admit that when i saw the last sentence i cant hold but laugh
i’m glad that i helped you. I temporary stopped my android stuff coz i’ve been going home 3am from my work and no time to invest on it. Btw i work in Hong Kong which going overtime is quite normal
[...] Create a sd card image [...]
Thanks a lot.. It worked.
I created the sdcard image and then used mount command directly to put the files in that.
Thanks again
Your welcome, glad it helped
Hi,
Could you please, tell me the procedure to create SD card in Windows XP….
Can you reply me through mail..
Thanks in advance!!!
Thanks Again!
Yasmin