2010年1月21日 星期四

Set up SD card for your Android Emulator with Window XP




First,
start cmd. 開始->執行->cmd
Second,
You can access mksdcard in the tools/ directory of the SDK which like "C:\android-sdk-windows-1.6_r1\tools",
cd C:\android-sdk-windows-1.6_r1\tools
and then create a disk image like this:
mksdcard <size> <file>
mksdcard 1024M C:\sdcardImg\sdcard.img
wait about 30 second.
Third,
create a Emulator with Eclipse
window->Android SDK and AVD Manager->New, then choice a target and SD Card->File with img

Fourth,
Run the Emulator, then you will see the view like next picture at setting->SD card& phone storage.

But, how do we put files into the sdcard?
There are some example which put the mp3 file into sdcard.
First, open the cmd and we can use command "adb push 'file path' /sdcard" in the tools/ directory of the SDK.

Then we type command "adb shell" and type "ls -l /sdcard".
you can see the following picture, and you will find out the file is put in the /sdcard successfully.











we can check the file with Emulator, too.
music->songs



Reference: