Error message

The spam filter installed on this site is currently unavailable. Per site policy, we are unable to accept new submissions until that problem is resolved. Please try resubmitting the form in a couple of minutes.

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...

  1. Launch your AVD with SD card from Eclipse that you created earlier
  2. From DDMS, go to 'Device -> File Explorer' 
  3. Select the 'sdcard' folder
  4. Click the 'push file onto device' button
  5. 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

Its really helpful to me for testing in emulator. Thank you for such nice stuff.

Add new comment