<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Jayway Team Blog &#187; Mårten Österberg</title>
	<atom:link href="http://blog.jayway.com/author/martenosterberg/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.jayway.com</link>
	<description>Sharing Experience</description>
	<lastBuildDate>Sat, 11 Feb 2012 10:33:02 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Working with SD cards in the Android emulator</title>
		<link>http://blog.jayway.com/2009/04/22/working-with-sd-cards-in-the-android-emulator/</link>
		<comments>http://blog.jayway.com/2009/04/22/working-with-sd-cards-in-the-android-emulator/#comments</comments>
		<pubDate>Wed, 22 Apr 2009 09:05:20 +0000</pubDate>
		<dc:creator>Mårten Österberg</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Embedded]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[mobile]]></category>
		<category><![CDATA[sdk]]></category>
		<category><![CDATA[tools]]></category>

		<guid isPermaLink="false">http://blog.jayway.com/?p=1537</guid>
		<description><![CDATA[Working with external storage in the Android emulator could be a little tricky and the documentation is not easy to find. I'll try to give a brief walk through of the steps needed to create a SD card image, mount the image in Linux, put content on it and use it in the emulator. Creating [...]]]></description>
			<content:encoded><![CDATA[<p>Working with external storage in the Android emulator could be a little tricky and the documentation is not easy to find. I'll try to give a brief walk through of the steps needed to create a SD card image, mount the image in Linux, put content on it and use it in the emulator. </p>
<p><strong>Creating a SD card image</strong><br />
In both the 1.1 and 1.5 version of the SDK there is a tool called mksdcard located in the <code>SDK Install Dir/tools</code> folder. Simply run </p>
<pre class="bash">./mksdcard 128M my128MbCard</pre>
<p>to create a 128Mb SD card with the name my128MbCard.</p>
<p><strong>Mounting a SD card image in Linux</strong><br />
To be able to put content on to the card you can mount the card in Linux. It will then simply appear as a folder in the filesystem.<br />
First make a directory in the /media folder:
<pre class="bash"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">mkdir</span> /media/mycard</pre>
<p>Then mount the card as a <a href="http://en.wikipedia.org/wiki/Loop_device">loopback device</a>:
<pre class="bash"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">mount</span> -o loop my128MbCard /media/mycard</pre>
<p><strong>Adding content to the card</strong><br />
With content we usually mean media content like images and videos. Images and videos are located in a folder called <code>/dcim/Camera</code>. You could of course add any content to the card. When you are done copying your files be sure to umount the card otherwise it will not be usable from the emulator.
<pre class="bash"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">umount</span> /media/mycard/</pre>
<p><strong>Using the card in the emulator</strong><br />
Google added something called Android Virtual Device (AVD) to the SDK 1.5. To create a new AVD using our newly created SDcard image run the following:
<pre class="bash">./android create avd --name myAVD --target <span style="color: #000000;">2</span> --sdcard my128MbCard</pre>
<p>Target 2 means that we want to use the 1.5 API features in the device. Now we simply fire up the emulator and start using our content:
<pre class="bash">./emulator -avd myAVD</pre>
<p>More information about the new SDK can be found here: <a href="http://developer.android.com/sdk/preview/">SDK</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.jayway.com/2009/04/22/working-with-sd-cards-in-the-android-emulator/feed/</wfw:commentRss>
		<slash:comments>32</slash:comments>
		</item>
	</channel>
</rss>

