Android Experience

helping others learn from my experiences with android development and opening up the posibilities it holds

Setting up an SD Card for the Android Emulator


While starting to setup my environment (Ubuntu and Eclipse) to start creating Andoid applications I realised that I need to find a way to create an SD Card for the Emulator. Not that it is essential to be able to develop and test on the emulator but if you are wanting to create apps that also use the media functionality within Android then you are going to need some media.

Luckily the emulator comes with a means to pass in arguments which include defining an SD Card image. When searching the Android site I found the information on how to setup the Emulator. Here there are instructions on creating an SD Card image which you can then add files to and pass into the emulator through the arguments. Following these instructions was relatively straight forward but I did find some steps required some research. Here is what I found….

To create the image you can use the mksdcard command which is found in the tools folder of your android sdk. I used the following

/$ ./mksdcard -l sd1024M 1024M /home/android/sd1024M.img

which equates to

/$ mksdcard [-l label] <size> <file>

You can then use a tool like mtools to copy content into the image.

/$ mtools -c mcopy -i /home/android/sd1024M.img -v -s /home/android/path/to/folder/ ::

Finally add the SD Card to the arguments in the emulator so that the content becomes accesible when you run it.

/$ -sdcard /home/android/sd1024M.img

From there you should be able to access files such as music and photos to help fine tune and improve the quality of your results.

Advertisement

Filed under: android

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Pages

follow me on twitter

Follow

Get every new post delivered to your Inbox.