The following commands will create, mount the SD card and finally push the songs to the SD card and emulator playing those songs/pictures.
- C:\android-sdk-windows-1.5_r3\tools>mksdcard -l sd500m 500M C:\android-sdk-windows-1.5_r3\tools\mysdcard.img ...... mksdcard: create a blank FAT32 image to be used with the Android emulator
usage: mksdcard [-l label]
ifis a simple integer, it specifies a size in bytes
ifis an integer followed by 'K', it specifies a size in KiB
ifis an integer followed by 'M', it specifies a size in MiBto create sdcard - The following size file will be created in tools directory of android-SDK. You can also create SD card with any memory size - say, 256M, 512M, 1024M, 2048M.
- To mount on emulator without specifying -avd C:\android-sdk-windows-1.5_r3\tools>emulator -sdcard mysdcard.img
emulator: ERROR: You did not provide the name of an Android Virtual Device
with the '-avd' option. Read -help-avd for more information.
If you *really* want to *NOT* run an AVD, consider using '-data'to specify a data partition image file (I hope you know what you're doing). However, this command will work fine with android-sdk-windows-1.0_r1 (as in my previous post). - The correct command to mount SD card is on latest android version is ..... C:\android-sdk-windows-1.5_r3\tools>emulator -sdcard mysdcard.img -avd opus29
- However, if, the emulator instance is already running, it gives the following error: emulator: ERROR: the user data image is used by another emulator. Aborting (so close the running emulator and then type again the following command).
- C:\android-sdk-windows-1.5_r3\tools>emulator -sdcard mysdcard.img -avd opus29 (this will run the new emulator instance with the SD card on it).
- To push songs on the emulator using Eclipse->Window->Open Perspective->Other->DDMS
- Choosing DDMS.
- the DDMS dialog box opens up ... on right side, we have tabs like @File Explorer ... there is sdcard folder with d--rxrwx permissions.
- Drag and Drop the audio / music files and picture files to this card with all the extensions like .wma, mp3, etc.
- This is how it looks finally in SDcard.
- Play files on the emulator. However if you have problems running any files on emulator, try to re-run the instance of the emulator after closing using the same command C:\android-sdk-windows-1.5_r3\tools>emulator -sdcard mysdcard.img -avd opus29.
- This is how the picture folder will look like.
- Follow the following steps have to be redone if you have changed the version of android SDK and not updated eclipse. http://developer.android.com/sdk/1.5_r3/upgrading.html
1 comment:
Thank you for the article.
Post a Comment