Create an Android Emulator SD Card and Write Data To It
Category:
Create the SD Card...
Let's create a 64MB sd card for our Android emulator, shall we?
Linux
From a terminal...
# cd ~/android-sdk-linux/tools # ./mksdcard 64M ~/Desktop/sdcard.iso
Windows XP
From a DOS prompt...
cd C:\Program Files\android-sdk-windows\tools mksdcard 64M c:\documents and settings\tyler\desktop\sdcard.iso
Now you can use the 'Eclipse Android SDK and AVD Manager' to create a new android virtual device that can use the path to the sd card you created.
Write Data to the SD Card...
Linux
From a terminal...
# cd ~/android-sdk-linux/tools # ./ddms
Windows XP
From a DOS prompt...
cd C:\Program Files\android-sdk-windows\tools ddms
This will start the Dalvik Debug Monitor Server. Next...
- Launch your AVD with SD card from Eclipse that you created earlier
- From DDMS, go to 'Device -> File Explorer'
- Select the 'sdcard' folder
- Click the 'push file onto device' button
- Find your file and click open
That's it!
Now from inside your code you can get to the sd card's path with: Environment.getExternalStorageDirectory()
Comments
Shailendra Singh (not verified)
Thu, 01/12/2012 - 08:02
Permalink
Its really helpful to me for
Its really helpful to me for testing in emulator. Thank you for such nice stuff.