<?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>Matthias Shapiro</title>
	<atom:link href="http://matthiasshapiro.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://matthiasshapiro.com</link>
	<description>microsoft windows phone evangelist, infovis enthusiast</description>
	<lastBuildDate>Mon, 17 Jun 2013 17:21:52 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>Calculating Distance From 2 GeoCoordinates in Windows Phone 8</title>
		<link>http://matthiasshapiro.com/2013/06/17/calculating-distance-from-2-geocoordinates-in-windows-phone-8/</link>
		<comments>http://matthiasshapiro.com/2013/06/17/calculating-distance-from-2-geocoordinates-in-windows-phone-8/#comments</comments>
		<pubDate>Mon, 17 Jun 2013 17:21:09 +0000</pubDate>
		<dc:creator>matthiasshapiro</dc:creator>
				<category><![CDATA[Maps]]></category>
		<category><![CDATA[Windows Phone]]></category>
		<category><![CDATA[Windows Phone 8]]></category>

		<guid isPermaLink="false">http://matthiasshapiro.com/?p=1741</guid>
		<description><![CDATA[<p>This is a support post for the <a href="http://channel9.msdn.com/Shows/Inside+Windows+Phone/Location-and-Mapping-for-Windows-Phone-8">Inside Windows Phone show on location and mapping in Windows Phone 8 published here.</a> </p>
<p>Calculating the distance between two GeoCoordinates in Windows Phone 8 is about as simple as it can get. First, &#8230;</p>]]></description>
				<content:encoded><![CDATA[<p>This is a support post for the <a href="http://channel9.msdn.com/Shows/Inside+Windows+Phone/Location-and-Mapping-for-Windows-Phone-8">Inside Windows Phone show on location and mapping in Windows Phone 8 published here.</a> </p>
<p>Calculating the distance between two GeoCoordinates in Windows Phone 8 is about as simple as it can get. First, get a GeoCoordinate. One handy way of doing this is to get the location of a tap on the Map control.</p>
<p>Set up the tap event hander on your Map:</p>
<pre class="code">&lt;span style=&quot;background: white; color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;background: white; color: rgb(163, 21, 21);&quot;&gt;maps&lt;/span&gt;&lt;span style=&quot;background: white; color: blue;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;background: white; color: rgb(163, 21, 21);&quot;&gt;Map &lt;/span&gt;&lt;span style=&quot;background: white; color: red;&quot;&gt;x&lt;/span&gt;&lt;span style=&quot;background: white; color: blue;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;background: white; color: red;&quot;&gt;Name&lt;/span&gt;&lt;span style=&quot;background: white; color: blue;&quot;&gt;=&amp;quot;myMap&amp;quot; &lt;/span&gt;&lt;span style=&quot;background: white; color: red;&quot;&gt;Tap&lt;/span&gt;&lt;span style=&quot;background: white; color: blue;&quot;&gt;=&amp;quot;ReadMapTap&amp;quot; /&amp;gt;&lt;/span&gt;</pre>
<p>And then translate the tap location into a GeoCoordinate like so:</p>
<pre class="code">&lt;span style=&quot;background: white; color: blue;&quot;&gt;void &lt;/span&gt;&lt;span style=&quot;background: white; color: black;&quot;&gt;ReadMapTap(&lt;/span&gt;&lt;span style=&quot;background: white; color: blue;&quot;&gt;object &lt;/span&gt;&lt;span style=&quot;background: white; color: black;&quot;&gt;sender, System.Windows.Input.&lt;/span&gt;&lt;span style=&quot;background: white; color: rgb(43, 145, 175);&quot;&gt;GestureEventArgs &lt;/span&gt;&lt;span style=&quot;background: white; color: black;&quot;&gt;e)
{
    &lt;/span&gt;&lt;span style=&quot;background: white; color: rgb(43, 145, 175);&quot;&gt;GeoCoordinate &lt;/span&gt;&lt;span style=&quot;background: white; color: black;&quot;&gt;tapLocation = &lt;br /&gt;         &lt;/span&gt;&lt;span style=&quot;background: white; color: black;&quot;&gt;distanceMap.ConvertViewportPointToGeoCoordinate(e.GetPosition((&lt;/span&gt;&lt;span style=&quot;background: white; color: rgb(43, 145, 175);&quot;&gt;UIElement&lt;/span&gt;&lt;span style=&quot;background: white; color: black;&quot;&gt;)sender));
}&lt;/span&gt;</pre>
<p>Then we just create another GeoCoordinate, like maybe Microsoft campus:</p>
<pre class="code">&lt;span style=&quot;background: white; color: rgb(43, 145, 175);&quot;&gt;GeoCoordinate &lt;/span&gt;&lt;span style=&quot;background: white; color: black;&quot;&gt;Msft = &lt;/span&gt;&lt;span style=&quot;background: white; color: blue;&quot;&gt;new &lt;/span&gt;&lt;span style=&quot;background: white; color: rgb(43, 145, 175);&quot;&gt;GeoCoordinate&lt;/span&gt;&lt;span style=&quot;background: white; color: black;&quot;&gt;(47.6396, -122.1300);&lt;/span&gt;</pre>
<p>And just ask one of our GeoCoordinates how far it is to the other one. </p>
<pre class="code">&lt;span style=&quot;background: white; color: blue;&quot;&gt;double &lt;/span&gt;&lt;span style=&quot;background: white; color: black;&quot;&gt;distanceToMSFT = tapLocation.GetDistanceTo(Msft);
&lt;/span&gt;&lt;span style=&quot;background: white; color: rgb(43, 145, 175);&quot;&gt;MessageBox&lt;/span&gt;&lt;span style=&quot;background: white; color: black;&quot;&gt;.Show(&lt;/span&gt;&lt;span style=&quot;background: white; color: rgb(163, 21, 21);&quot;&gt;&amp;quot;It is &amp;quot; &lt;/span&gt;&lt;span style=&quot;background: white; color: black;&quot;&gt;+ distanceToMSFT.ToString() + &lt;/span&gt;&lt;span style=&quot;background: white; color: rgb(163, 21, 21);&quot;&gt;&amp;quot; meters from there to Microsoft!&amp;quot;&lt;/span&gt;&lt;span style=&quot;background: white; color: black;&quot;&gt;);
&lt;/span&gt;</pre>
<p>The result will be in meters and is based on the <a href="http://www.movable-type.co.uk/scripts/latlong.html">haversine formula</a> for calculating distance over the surface of the earth (my favorite!)</p>
]]></content:encoded>
			<wfw:commentRss>http://matthiasshapiro.com/2013/06/17/calculating-distance-from-2-geocoordinates-in-windows-phone-8/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Reverse Geocoding in Windows Phone 8</title>
		<link>http://matthiasshapiro.com/2013/06/17/reverse-geocoding-in-windows-phone-8/</link>
		<comments>http://matthiasshapiro.com/2013/06/17/reverse-geocoding-in-windows-phone-8/#comments</comments>
		<pubDate>Mon, 17 Jun 2013 17:20:25 +0000</pubDate>
		<dc:creator>matthiasshapiro</dc:creator>
				<category><![CDATA[Maps]]></category>
		<category><![CDATA[Windows Phone 8]]></category>

		<guid isPermaLink="false">http://matthiasshapiro.com/?p=1739</guid>
		<description><![CDATA[<p>This is a support post for the <a href="http://channel9.msdn.com/Shows/Inside+Windows+Phone/Location-and-Mapping-for-Windows-Phone-8">Inside Windows Phone show on location and mapping in Windows Phone 8 published here.</a> </p>
<p>Reverse geocoding is the process of getting an address from a latitude/longitude pair. With Windows Phone, this process is &#8230;</p>]]></description>
				<content:encoded><![CDATA[<p>This is a support post for the <a href="http://channel9.msdn.com/Shows/Inside+Windows+Phone/Location-and-Mapping-for-Windows-Phone-8">Inside Windows Phone show on location and mapping in Windows Phone 8 published here.</a> </p>
<p>Reverse geocoding is the process of getting an address from a latitude/longitude pair. With Windows Phone, this process is not only easy, it works in conjunction with the offline mapping capability so that developers can query addresses from a geocoordinate even when there is no data signal available.</p>
<p>The process is extremely straightforward: Add the namespace</p>
<pre class="code">&lt;span style=&quot;background: white; color: blue;&quot;&gt;using &lt;/span&gt;&lt;span style=&quot;background: white; color: black;&quot;&gt;Microsoft.Phone.Maps.Services;&lt;/span&gt;</pre>
<p>And create a new ReverseGeocodeQuery, give it a valid GeoCoordinate and set up the an event handler to manage the result.</p>
<pre class="code">&lt;span style=&quot;background: white; color: rgb(43, 145, 175);&quot;&gt;ReverseGeocodeQuery &lt;/span&gt;&lt;span style=&quot;background: white; color: black;&quot;&gt;reverseGeocode = &lt;/span&gt;&lt;span style=&quot;background: white; color: blue;&quot;&gt;new &lt;/span&gt;&lt;span style=&quot;background: white; color: rgb(43, 145, 175);&quot;&gt;ReverseGeocodeQuery&lt;/span&gt;&lt;span style=&quot;background: white; color: black;&quot;&gt;();
&lt;/span&gt;&lt;span style=&quot;background: white; color: black;&quot;&gt;reverseGeocode.GeoCoordinate = &lt;/span&gt;&lt;span style=&quot;background: white; color: blue;&quot;&gt;new &lt;/span&gt;&lt;span style=&quot;background: white; color: rgb(43, 145, 175);&quot;&gt;GeoCoordinate&lt;/span&gt;&lt;span style=&quot;background: white; color: black;&quot;&gt;(47.60887, -122.34094);
reverseGeocode.QueryCompleted += reverseGeocode_QueryCompleted;
reverseGeocode.QueryAsync();&lt;/span&gt;</pre>
<p>Then in our event handler we will get a result (or list of possible results) back as a MapAddress object.</p>
<pre class="code">&lt;span style=&quot;background: white; color: blue;&quot;&gt;void &lt;/span&gt;&lt;span style=&quot;background: white; color: black;&quot;&gt;reverseGeocode_QueryCompleted(&lt;/span&gt;&lt;span style=&quot;background: white; color: blue;&quot;&gt;object &lt;/span&gt;&lt;span style=&quot;background: white; color: black;&quot;&gt;sender, &lt;/span&gt;&lt;span style=&quot;background: white; color: rgb(43, 145, 175);&quot;&gt;QueryCompletedEventArgs&lt;/span&gt;&lt;span style=&quot;background: white; color: black;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;background: white; color: rgb(43, 145, 175);&quot;&gt;IList&lt;/span&gt;&lt;span style=&quot;background: white; color: black;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;background: white; color: rgb(43, 145, 175);&quot;&gt;MapLocation&lt;/span&gt;&lt;span style=&quot;background: white; color: black;&quot;&gt;&amp;gt;&amp;gt; e)
{
    &lt;/span&gt;&lt;span style=&quot;background: white; color: rgb(43, 145, 175);&quot;&gt;MapAddress &lt;/span&gt;&lt;span style=&quot;background: white; color: black;&quot;&gt;geoAddress = e.Result[0].Information.Address;           
}&lt;/span&gt;</pre>
<p> This object will contain a nice helpful set of properties that we can then use to construct a valid address. </p>
<p><a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-55-32-metablogapi/0245.image_5F00_326912E9.png"><img title="image" style="display: inline; background-image: none;" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-55-32-metablogapi/3872.image_5F00_thumb_5F00_5217ECB1.png" width="399" height="310">&#160;</img></a></p>
]]></content:encoded>
			<wfw:commentRss>http://matthiasshapiro.com/2013/06/17/reverse-geocoding-in-windows-phone-8/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Finding and Mapping a Route in Windows Phone 8</title>
		<link>http://matthiasshapiro.com/2013/06/17/finding-and-mapping-a-route-in-windows-phone-8/</link>
		<comments>http://matthiasshapiro.com/2013/06/17/finding-and-mapping-a-route-in-windows-phone-8/#comments</comments>
		<pubDate>Mon, 17 Jun 2013 17:19:36 +0000</pubDate>
		<dc:creator>matthiasshapiro</dc:creator>
				<category><![CDATA[Maps]]></category>
		<category><![CDATA[Windows Phone]]></category>
		<category><![CDATA[Windows Phone 8]]></category>

		<guid isPermaLink="false">http://matthiasshapiro.com/?p=1738</guid>
		<description><![CDATA[<p>This is a support post for the <a href="http://channel9.msdn.com/Shows/Inside+Windows+Phone/Location-and-Mapping-for-Windows-Phone-8">Inside Windows Phone show on location and mapping in Windows Phone 8 published here.</a> </p>
<p>One of the really cool and powerful things in the Windows Phone mapping services is the ability to simple &#8230;</p>]]></description>
				<content:encoded><![CDATA[<p>This is a support post for the <a href="http://channel9.msdn.com/Shows/Inside+Windows+Phone/Location-and-Mapping-for-Windows-Phone-8">Inside Windows Phone show on location and mapping in Windows Phone 8 published here.</a> </p>
<p>One of the really cool and powerful things in the Windows Phone mapping services is the ability to simple hand the Windows Phone APIs a list of geo coordinates and have it create walking or driving route on the fly. Because of the power of offline mapping in Windows Phone 8, this means that developers can create extremely powerful directional software that works even when the phone doesn’t have network connectivity. </p>
<p>The first thing we need to do is set up a map control on which to display our resulting route.</p>
<p>In XAML:</p>
<pre class="code">&lt;span style=&quot;background: white; color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;background: white; color: rgb(163, 21, 21);&quot;&gt;maps&lt;/span&gt;&lt;span style=&quot;background: white; color: blue;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;background: white; color: rgb(163, 21, 21);&quot;&gt;Map &lt;/span&gt;&lt;span style=&quot;background: white; color: red;&quot;&gt;x&lt;/span&gt;&lt;span style=&quot;background: white; color: blue;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;background: white; color: red;&quot;&gt;Name&lt;/span&gt;&lt;span style=&quot;background: white; color: blue;&quot;&gt;=&amp;quot;myMap&amp;quot; &lt;/span&gt;&lt;span style=&quot;background: white; color: blue;&quot;&gt;/&amp;gt;&lt;/span&gt;</pre>
<p>Then we’ll set up a list of geocoordinates representing the order of the places we want to use to establish our route and add some locations to it. </p>
<pre class="code">&lt;span style=&quot;background: white; color: rgb(43, 145, 175);&quot;&gt;List&lt;/span&gt;&lt;span style=&quot;background: white; color: black;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;background: white; color: rgb(43, 145, 175);&quot;&gt;GeoCoordinate&lt;/span&gt;&lt;span style=&quot;background: white; color: black;&quot;&gt;&amp;gt; wayPoints = &lt;/span&gt;&lt;span style=&quot;background: white; color: blue;&quot;&gt;new &lt;/span&gt;&lt;span style=&quot;background: white; color: rgb(43, 145, 175);&quot;&gt;List&lt;/span&gt;&lt;span style=&quot;background: white; color: black;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;background: white; color: rgb(43, 145, 175);&quot;&gt;GeoCoordinate&lt;/span&gt;&lt;span style=&quot;background: white; color: black;&quot;&gt;&amp;gt;();
wayPoints.Add(&lt;/span&gt;&lt;span style=&quot;background: white; color: blue;&quot;&gt;new &lt;/span&gt;&lt;span style=&quot;background: white; color: rgb(43, 145, 175);&quot;&gt;GeoCoordinate&lt;/span&gt;&lt;span style=&quot;background: white; color: black;&quot;&gt;(47.60887, -122.34094));
wayPoints.Add(&lt;/span&gt;&lt;span style=&quot;background: white; color: blue;&quot;&gt;new &lt;/span&gt;&lt;span style=&quot;background: white; color: rgb(43, 145, 175);&quot;&gt;GeoCoordinate&lt;/span&gt;&lt;span style=&quot;background: white; color: black;&quot;&gt;(47.6396, -122.1300)); &lt;/span&gt;</pre>
<p>Then set up our RouteQuery object, assign an event handler so we can read the result, choose between a route for walking or driving and then assign the list of geo coordinates and we’re off!</p>
<pre class="code">&lt;span style=&quot;background: white; color: rgb(43, 145, 175);&quot;&gt;RouteQuery &lt;/span&gt;&lt;span style=&quot;background: white; color: black;&quot;&gt;routeQuery = &lt;/span&gt;&lt;span style=&quot;background: white; color: blue;&quot;&gt;new &lt;/span&gt;&lt;span style=&quot;background: white; color: rgb(43, 145, 175);&quot;&gt;RouteQuery&lt;/span&gt;&lt;span style=&quot;background: white; color: black;&quot;&gt;();
routeQuery.QueryCompleted += routeQuery_QueryCompleted;
routeQuery.TravelMode = &lt;/span&gt;&lt;span style=&quot;background: white; color: rgb(43, 145, 175);&quot;&gt;TravelMode&lt;/span&gt;&lt;span style=&quot;background: white; color: black;&quot;&gt;.Walking;                    
routeQuery.Waypoints = wayPoints;
routeQuery.QueryAsync();&lt;/span&gt;</pre>
<p>The RouteQuery will work for a little while and then return with (what is hopefully) a suitable route made of </p>
<pre class="code">&lt;span style=&quot;background: white; color: blue;&quot;&gt;void &lt;/span&gt;&lt;span style=&quot;background: white; color: black;&quot;&gt;routeQuery_QueryCompleted(&lt;/span&gt;&lt;span style=&quot;background: white; color: blue;&quot;&gt;object &lt;/span&gt;&lt;span style=&quot;background: white; color: black;&quot;&gt;sender, &lt;/span&gt;&lt;span style=&quot;background: white; color: rgb(43, 145, 175);&quot;&gt;QueryCompletedEventArgs&lt;/span&gt;&lt;span style=&quot;background: white; color: black;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;background: white; color: rgb(43, 145, 175);&quot;&gt;Route&lt;/span&gt;&lt;span style=&quot;background: white; color: black;&quot;&gt;&amp;gt; e)
{
    &lt;/span&gt;&lt;span style=&quot;background: white; color: blue;&quot;&gt;if &lt;/span&gt;&lt;span style=&quot;background: white; color: black;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;background: white; color: blue;&quot;&gt;null &lt;/span&gt;&lt;span style=&quot;background: white; color: black;&quot;&gt;== e.Error)
    {
        &lt;/span&gt;&lt;span style=&quot;background: white; color: rgb(43, 145, 175);&quot;&gt;Route &lt;/span&gt;&lt;span style=&quot;background: white; color: black;&quot;&gt;MyRoute = e.Result;
&lt;/span&gt;&lt;span style=&quot;background: white; color: black;&quot;&gt;    }
}&lt;/span&gt;</pre>
<p>The result will be a Route object that gives an estimated duration for travelling the route as well as an enormous amount of detailed data about how to get from point A to point B (and then, subsequently, points C, D, and E). The instructions between each point are kept in the Legs property of the Route and each leg has every street and every turn detailed in the Maneuvers property. It’s really easy to work with. </p>
<p>But even better than that is the fact adding the route to your map is only 1 line of code (but I like to use 3 to make things easier):</p>
<pre class="code">&lt;span style=&quot;background: white; color: rgb(43, 145, 175);&quot;&gt;Route &lt;/span&gt;&lt;span style=&quot;background: white; color: black;&quot;&gt;MyRoute = e.Result;
&lt;/span&gt;&lt;span style=&quot;background: white; color: rgb(43, 145, 175);&quot;&gt;MapRoute &lt;/span&gt;&lt;span style=&quot;background: white; color: black;&quot;&gt;mappedRoute = &lt;/span&gt;&lt;span style=&quot;background: white; color: blue;&quot;&gt;new &lt;/span&gt;&lt;span style=&quot;background: white; color: rgb(43, 145, 175);&quot;&gt;MapRoute&lt;/span&gt;&lt;span style=&quot;background: white; color: black;&quot;&gt;(MyRoute);
scavangeMap.AddRoute(&lt;span style=&quot;background: white; color: black;&quot;&gt;mappedRoute&lt;/span&gt;);
scavangeMap.SetView(&lt;span style=&quot;background: white; color: black;&quot;&gt;mappedRoute&lt;/span&gt;.Route.BoundingBox);&lt;/span&gt;</pre>
<p>What I’ve done here is add the UI to represent this route to my map and then moved and scaled the map so that it is in the perfect spot for the user to start interacting with the route.</p>
]]></content:encoded>
			<wfw:commentRss>http://matthiasshapiro.com/2013/06/17/finding-and-mapping-a-route-in-windows-phone-8/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using Offline Maps in Windows Phone 8</title>
		<link>http://matthiasshapiro.com/2013/06/17/using-offline-maps-in-windows-phone-8/</link>
		<comments>http://matthiasshapiro.com/2013/06/17/using-offline-maps-in-windows-phone-8/#comments</comments>
		<pubDate>Mon, 17 Jun 2013 17:18:54 +0000</pubDate>
		<dc:creator>matthiasshapiro</dc:creator>
				<category><![CDATA[Maps]]></category>
		<category><![CDATA[Windows Phone 8]]></category>

		<guid isPermaLink="false">http://matthiasshapiro.com/?p=1736</guid>
		<description><![CDATA[<p>This is a support post for the <a href="http://channel9.msdn.com/Shows/Inside+Windows+Phone/Location-and-Mapping-for-Windows-Phone-8">Inside Windows Phone show on location and mapping in Windows Phone 8 published here.</a> </p>
<p>I love the offline maps feature in Windows Phone. I love to travel and I frequently find myself in &#8230;</p>]]></description>
				<content:encoded><![CDATA[<p>This is a support post for the <a href="http://channel9.msdn.com/Shows/Inside+Windows+Phone/Location-and-Mapping-for-Windows-Phone-8">Inside Windows Phone show on location and mapping in Windows Phone 8 published here.</a> </p>
<p>I love the offline maps feature in Windows Phone. I love to travel and I frequently find myself in need to maps even when I don’t have good connectivity on my device (especially in other countries). </p>
<p>The great news for developers is that when the users have downloaded maps for offline use, we get a huge number of benefits. We can get addresses offline using reverse geocoding, we can map directions for walking or driving, we can know that our mapping is still strong despite a lack of connectivity.</p>
<p>Of course, we get all that for free only if the user downloads the maps for offline use. But driving them to this is fairly easy to do. All it takes is:</p>
<pre class="code">&lt;span style=&quot;background: white; color: rgb(43, 145, 175);&quot;&gt;MapDownloaderTask &lt;/span&gt;&lt;span style=&quot;background: white; color: black;&quot;&gt;mdt = &lt;/span&gt;&lt;span style=&quot;background: white; color: blue;&quot;&gt;new &lt;/span&gt;&lt;span style=&quot;background: white; color: rgb(43, 145, 175);&quot;&gt;MapDownloaderTask&lt;/span&gt;&lt;span style=&quot;background: white; color: black;&quot;&gt;();
mdt.Show();&lt;/span&gt;</pre>
<p>And this pushes us into the native UI for downloading the maps. If we wanted to guild the user a little more clearly, we could perform a reverse geocode on their location and then give them guidance to what map we need them to download.</p>
]]></content:encoded>
			<wfw:commentRss>http://matthiasshapiro.com/2013/06/17/using-offline-maps-in-windows-phone-8/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Game Of Thrones Chapter Explorer Visualization</title>
		<link>http://matthiasshapiro.com/2013/04/05/game-of-thrones-chapter-explorer-visualization/</link>
		<comments>http://matthiasshapiro.com/2013/04/05/game-of-thrones-chapter-explorer-visualization/#comments</comments>
		<pubDate>Fri, 05 Apr 2013 05:28:40 +0000</pubDate>
		<dc:creator>matthiasshapiro</dc:creator>
				<category><![CDATA[Windows Phone]]></category>

		<guid isPermaLink="false">http://matthiasshapiro.com/?p=1723</guid>
		<description><![CDATA[<p>If you&#8217;re familiar with the Game of Thrones HBO series, you may know it&#8217;s derived from the Song of Ice and Fire books by George RR Martin. There are many remarkable things about the Song of Ice and Fire books &#8230;</p>]]></description>
				<content:encoded><![CDATA[<p>If you&#8217;re familiar with the Game of Thrones HBO series, you may know it&#8217;s derived from the Song of Ice and Fire books by George RR Martin. There are many remarkable things about the Song of Ice and Fire books (hereafter refered to as &#8220;Game of Thrones&#8221; books for the sake of simplicity).</p>
<ol>
<li>They&#8217;re long. All put together almost 4,500 pages with at least 2 more books on the way.</li>
<li>Every chapter assumes a unique character point of view.</li>
</ol>
<p>I love how the story jumps through so many characters and wanted to see how much of the story Martin assigned to which character POV, so I pieced together this visualization. Click on it to go to the interactive version which is way, way, way better. Note, however, that there are potential spoilers if you&#8217;ve watched the show and haven&#8217;t read all the books all the way through. (Also, oddly, there seems to be some weird issue&#8230; if it doesn&#8217;t load fully, just hit refresh.)</p>
<p><a href="http://matthiasshapiro.com/GoTVisual"><img class="alignnone  wp-image-1724" alt="Game Of Thrones Chapter Explorer" src="http://matthiasshapiro.com/wp-content/uploads/2013/04/Published_Visual.jpg" width="800" height="576" /></a></p>
<p>Because the books are so stinking long, every pixel in the interactive visual represents 5 pages. That makes the scale something like this:</p>
<p><a href="http://matthiasshapiro.com/wp-content/uploads/2013/04/Tutorial1_Scale.jpg"><img alt="Tutorial1_Scale" src="http://matthiasshapiro.com/wp-content/uploads/2013/04/Tutorial1_Scale.jpg" width="145" height="100" /></a></p>
<p>I took every chapter in the Game of Thrones books and then logged the character point of view. Then I grouped those characters by the house they belong to (or serve). The width of the house (and of the character&#8217;s image) indicates how much of the story is told from their point of view.</p>
<p><a style="color: #ff4b33; line-height: 24px;" href="http://matthiasshapiro.com/wp-content/uploads/2013/04/House-Lesson.jpg"><img class="alignnone size-full wp-image-1725" alt="House Lesson" src="http://matthiasshapiro.com/wp-content/uploads/2013/04/House-Lesson.jpg" width="257" height="220" /></a></p>
<p>&nbsp;</p>
<p>Each chapter is represented by a line between the place in the book where the chapter is located and the character whose POV the chapter is told from. The chapter lines are sized according to how many pages the chapter runs.</p>
<p><a href="http://matthiasshapiro.com/wp-content/uploads/2013/04/Tutorial1_Example.jpg"><img class="alignnone size-medium wp-image-1726" alt="Tutorial1_Example" src="http://matthiasshapiro.com/wp-content/uploads/2013/04/Tutorial1_Example.jpg" width="275" height="201" /></a></p>
<p>Finally, when you hover over a book or a house or a character, you&#8217;ll see the chapters the belong to that book (or house or character) highlighted.</p>
<p><a style="line-height: 24px; color: #ff4b33;" href="http://matthiasshapiro.com/wp-content/uploads/2013/04/Tutorial2_Hover.jpg"><img class="alignnone size-medium wp-image-1728" alt="Tutorial2_Hover" src="http://matthiasshapiro.com/wp-content/uploads/2013/04/Tutorial2_Hover-140x300.jpg" width="140" height="300" /></a></p>
<p>&nbsp;</p>
<p>Enjoy! I hope you have as much exploring the books with this as I had creating this visualization.</p>
]]></content:encoded>
			<wfw:commentRss>http://matthiasshapiro.com/2013/04/05/game-of-thrones-chapter-explorer-visualization/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Missing OpenStreamForWriteAsync on my StorageFile</title>
		<link>http://matthiasshapiro.com/2013/03/12/missing-openstreamforwriteasync-on-my-storagefile/</link>
		<comments>http://matthiasshapiro.com/2013/03/12/missing-openstreamforwriteasync-on-my-storagefile/#comments</comments>
		<pubDate>Tue, 12 Mar 2013 22:09:02 +0000</pubDate>
		<dc:creator>matthiasshapiro</dc:creator>
				<category><![CDATA[Windows 8]]></category>
		<category><![CDATA[Windows Phone 8]]></category>
		<category><![CDATA[DataContractSerializer]]></category>
		<category><![CDATA[OpenStreamForReadAsync]]></category>
		<category><![CDATA[OpenStreamForWriteAsync]]></category>
		<category><![CDATA[StorageFile]]></category>

		<guid isPermaLink="false">http://matthiasshapiro.com/?p=1721</guid>
		<description><![CDATA[<p>I have a sample that I use when serializing data in order to save it to a StorageFile in Windows 8 and Windows Phone 8. It looks a little something (or exactly) like this:</p>
<pre class="code"><span style="background: white; color: #2b91af">StorageFile </span><span style="background: white; color: black">kittenFile = </span><span style="background: white; color: blue">await </span><span style="background: white; color: #2b91af">ApplicationData</span><span style="background: white; color: black">.Current.LocalFolder.CreateFileAsync(</span>&#8230;</pre>]]></description>
				<content:encoded><![CDATA[<p>I have a sample that I use when serializing data in order to save it to a StorageFile in Windows 8 and Windows Phone 8. It looks a little something (or exactly) like this:</p>
<pre class="code"><span style="background: white; color: #2b91af">StorageFile </span><span style="background: white; color: black">kittenFile = </span><span style="background: white; color: blue">await </span><span style="background: white; color: #2b91af">ApplicationData</span><span style="background: white; color: black">.Current.LocalFolder.CreateFileAsync(</span><span style="background: white; color: #a31515">"Kittens4Ever.kittens"</span><span style="background: white; color: black">, </span><span style="background: white; color: #2b91af">CreationCollisionOption</span><span style="background: white; color: black">.ReplaceExisting);

</span><span style="background: white; color: blue">var </span><span style="background: white; color: black">writeStream = </span><span style="background: white; color: blue">await </span><span style="background: white; color: black">kittenFile.OpenStreamForWriteAsync();
</span><span style="background: white; color: #2b91af">DataContractSerializer </span><span style="background: white; color: black">kittenSerial = </span><span style="background: white; color: blue">new </span><span style="background: white; color: #2b91af">DataContractSerializer</span><span style="background: white; color: black">(</span><span style="background: white; color: blue">typeof</span><span style="background: white; color: black">(</span><span style="background: white; color: #2b91af">ObservableCollection</span><span style="background: white; color: black">&lt;</span><span style="background: white; color: #2b91af">Kitten</span><span style="background: white; color: black">&gt;));
kittenSerial.WriteObject(writeStream, listOfKittens);
                        
</span><span style="background: white; color: blue">await </span><span style="background: white; color: black">writeStream.FlushAsync();
writeStream.Close();</span></pre>
<p>But I keep running into this problem where my StorageFile doesn’t have the OpenStreamForWriteAsync method available. After yelling and cursing and bing-ing the problem for a while, I realize the solution: </p>
<p>&nbsp;</p>
<p>OpenStreamForWriterAsync (and OpenStreaForReadAsync) are extension methods that require System.IO to be added as a reference. So I just add it</p>
<pre class="code"><span style="background: white; color: blue">using </span><span style="background: white; color: black">System.IO;</span></pre>
<p>and everything works fine.</p>
]]></content:encoded>
			<wfw:commentRss>http://matthiasshapiro.com/2013/03/12/missing-openstreamforwriteasync-on-my-storagefile/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Weekly Links &#8211; 2-11-2012</title>
		<link>http://matthiasshapiro.com/2013/02/11/weekly-links-2-11-2012/</link>
		<comments>http://matthiasshapiro.com/2013/02/11/weekly-links-2-11-2012/#comments</comments>
		<pubDate>Mon, 11 Feb 2013 16:48:34 +0000</pubDate>
		<dc:creator>matthiasshapiro</dc:creator>
				<category><![CDATA[Weekly Links]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[UX]]></category>
		<category><![CDATA[Windows 8]]></category>
		<category><![CDATA[Windows Phone]]></category>
		<category><![CDATA[Windows Phone 8]]></category>

		<guid isPermaLink="false">http://matthiasshapiro.com/?p=1705</guid>
		<description><![CDATA[<p>Due to travel and other engagements, I’ve missed a couple of weekly links, so this one will be slightly larger.</p>
<p>One thing I want to call out specifically is that Ben Riga and I have been working on a set &#8230;</p>]]></description>
				<content:encoded><![CDATA[<p>Due to travel and other engagements, I’ve missed a couple of weekly links, so this one will be slightly larger.</p>
<p>One thing I want to call out specifically is that Ben Riga and I have been working on a set of sessions on <a href="http://msl-events.cloudapp.net/EventRegistration.aspx?eid=14dccc84-f07f-4acf-a3e4-9707efe693c7&amp;mva=true">building for both Windows 8 and Windows Phone 8</a>. Ben will be presenting these sessions for Microsoft Virtual Academy on February 21st. I would be joining him except that I’m heading to Barcelona for Mobile World Congress that day. Nevertheless, it is a great set of lessons for building apps across Windows-based devices.</p>
<h2>Windows Phone 8</h2>
<ul>
<li><a href="http://blogs.windows.com/windows_phone/b/windowsphone/archive/2013/02/08/spotify-arrives-on-windows-phone-8.aspx">Spotify is available for Windows Phone 8</a>!
<li><a href="http://blog.brightpointuk.co.uk/running-windows-phone-8-emulator-mac-os">Running the Windows Phone 8 emulator on a Mac OS</a>
<li><a href="http://www.developer.nokia.com/Community/Wiki/Windows_Phone_8_SDK_on_a_Virtual_Machine_with_Working_Emulator">Windows Phone 8 SDK on a Virtual Machine with a Working Emulator</a>
<li><a href="http://msdn.microsoft.com/en-us/library/windowsphone/develop/hh394009(v=vs.105).aspx">Using the Share Link task for Windows Phone</a> – takes in a link and shares it with any of the social networks already integrated into the device
<li><a href="http://msdn.microsoft.com/en-us/library/windowsphone/develop/jj684580(v=vs.105).aspx">How to connect to a local web services using with Windows Phone 8 emulator</a> (hint: boundary machine)
<li><a href="http://cmsresources.windowsphone.com/devcenter/en-us/downloads/064028-microsoft-poster.pdf">Windows Phone API Quickstart</a> – a nice big visual summary of the Windows Phone APIs
<li><a href="https://nuget.org/packages/Coding4Fun.Toolkit.Complete/">Coding4Fun Toolkit</a>&nbsp; (Clint Rutkas) – An incredibly valuable toolkit for Windows Phone / Windows 8 development. Includes GzipWebclient, Audio Recorder, storage wrappers, additional controls. Really cool.
<li><a href="http://proximitytapper.codeplex.com/">Proximity Tapper</a> – NFC emulation for the Windows Phone emulator.
<li><a href="http://msicc.net/?p=3474">NFC Toolkit beta testing</a> – from <a href="https://twitter.com/#!/msicc">@MSicc</a>, a beta app for NFC tag reading, writing and profiles
<li><a href="http://www.windowsphone.com/en-us/how-to/wp8/windows-phone-app-for-desktop">Windows Phone app for desktop (Preview 3)</a> – The missing link between your Windows Phone 8 phone and your media libraries
<li><a href="http://msdn.microsoft.com/en-us/library/windowsphone/develop/jj206987(v=vs.105).aspx">Auto-launching apps using file and URI associations for Windows Phone 8</a> – an underappreciated feature, but one that I’ve implemented to great effect
<li><a href="http://blogs.msdn.com/b/mustafakasap/archive/2013/01/22/wallet-amp-in-app-purchase-for-windows-phone-8.aspx">Wallet and In-App Purchase for Windows Phone 8</a> ( Mustafa Kasap) – HUGE post on integrating Wallet features and functionality and in-app purchases into your Windows Phone app
<li><a href="http://matthiasshapiro.com/2013/01/27/using-an-adcontrol-in-a-trial-app-windows-phone/">Using an Ad Control in a Trial App (With Debugging Support)</a>
<li><a href="http://code.msdn.microsoft.com/site/search?f%5B0%5D.Type=Platform&amp;f%5B0%5D.Value=Phone&amp;f%5B0%5D.Text=Phone&amp;f%5B1%5D.Type=VisualStudioVersion&amp;f%5B1%5D.Value=11.0&amp;f%5B1%5D.Text=Visual%20Studio%202012&amp;f%5B2%5D.Type=Technology&amp;f%5B2%5D.Value=Windows%20Phone%208">All the MSDN Code Gallery samples for Windows Phone 8</a> (about 90 items)
<li><a href="http://www.wpcentral.com/super-nintendo-emulator-windows-phone-8?utm_source=wpc&amp;utm_medium=twitter">Super NES emulator app for Windows Phone 8</a>
<li><a href="http://www.engadget.com/2013/01/18/lumia-820-3d-printed-back-covers/?a_dgi=aolshare_twitter">3D Print your own Lumia 820 cover using the official specs from Nokia</a>
<li><a href="http://www.kunal-chowdhury.com/2011/11/how-can-you-add-network-connection.html">Adding Network Connection Settings to your Windows Phone app</a> (Airplane Mode, Bluetooth, Cell, Wifi)
<li><a href="http://codeiuse.tumblr.com/post/40635877824/basic-speech-synthesis-in-windows-phone-8">Basic Speech Synthesis in Windows Phone 8</a> (code)
<li><a href="http://codeiuse.tumblr.com/post/40635743354/basic-speech-recognition-in-windows-phone-8">Basic Speech Recognition in Windows Phone 8</a> (code)</li>
</ul>
<h2>Windows Phone 8 HTML/JS</h2>
<ul>
<li><a href="http://blogs.msdn.com/b/davedev/archive/2013/02/07/build-a-hybrid-app-for-windows-phone-8-using-appmobi.aspx">Build a Hybrid App for Windows Phone 8 using appMobi</a> (Dave Isbitski <a href="https://twitter.com/thedavedev">@thedavedev</a>) – Starting to see Windows Phone 8 support in a lot of the HTML5-based cross-platform tools.
<li><a href="http://www.yoyogames.com/gamemaker/studio/master">YoYo Games GameMaker Studio</a> – for cross-platform game development, supports Windows Phone 8 as well as Windows 8. (And also, iOS, Android and Mac OS, but no one cares about those, right?) </li>
</ul>
<h2>Windows 8</h2>
<ul>
<li><a href="http://msdn.microsoft.com/en-us/library/windows/apps/hh465496.aspx">Adding a ListView to Display a List of Items in Windows 8</a> (HTML/JS) And then <a href="http://msdn.microsoft.com/en-us/library/windows/apps/jj585523.aspx">adding a template and functionality to those listview items</a>
<li><a href="http://kevinashley.com/making-30000-a-month-on-windows-8-apps/">Making $30K a month on Windows 8 apps</a> – It can be done.
<li><a href="http://channel9.msdn.com/coding4fun/articles/Fall-Fury-Part-2-Shaders?utm_source=dlvr.it&amp;utm_medium=twitter">Fall Fury: Part 2 – Shaders</a> – Some of the geniuses at Channel 9 are outlining how they built the <a href="http://apps.microsoft.com/windows/en-us/app/c4f-fallfury/e23c36da-1a5e-4389-bcfc-ea388afc4746">Fall Fury game</a>
<li><a href="http://www.pocketgamer.biz/r/PG.Biz/Windows+8/news.asp?c=48217">HTML5 game Mudvark hitting hundreds of thousands of downloads on Windows 8</a>
<li><a href="http://www.sharpgis.net/post/2012/01/12/Reading-and-Writing-text-files-in-Windows-8-Metro.aspx">Reading and Writing Text Files in Windows 8 Metro Store Apps</a> (Morten Nielsen @dotMorten) – Same code also works in Windows Phone 8
<li><a href="http://blogs.msdn.com/b/codefx/archive/2013/01/16/i-have-an-ios-or-android-app-how-do-i-port-it-to-windows-store-app.aspx">How do I port my iOS or Android app to Windows 8</a> (Windows Store)? (videos)
<li><a href="http://winsupersite.com/windows-phone/windows-phone-8-tips-ultimate-compendium?utm_source=twitterfeed&amp;utm_medium=twitter">A stupid huge list of tips for using/configuring Windows 8</a></li>
</ul>
<h2>Design and UX</h2>
<ul>
<li><a href="http://apps.microsoft.com/windows/en-us/app/colour-scheme-creator/b855adae-990f-47e1-8fd6-0af66c24d487">Color Scheme Creator</a> – a simple Windows 8 app for constructing a color scheme based on a photograph
<li><a href="http://www.placecage.com/">PlaceCage</a> – a set of flexible image placeholders featuring Nic Cage
<li><a href="http://www.fredriklundwall.com/Fredrik_Lundwall/366_logos.html">366 Logos</a> – A logo a day every day of 2012. Each logo created in about an hour.</li>
</ul>
<h2>Other Awesome Things</h2>
<ul>
<li><a href="http://robrelyea.com/demos/KinectMagicMirror/">Kinect Magic Mirror demo code</a> (goes along with Rob Relyea’s <a href="http://channel9.msdn.com/Events/Build/2012/3-055">Kinect for Windows Programming Deep Drive Build talk</a>)
<li><a href="http://unicornfree.com/2013/why-we-shut-down-charm-on-the-eve-of-public-launch-at-48kyear-and-growing">Why We Shut Down Charm on the Even of Public Launch</a> (Amy Hoy <a href="http://twitter.com/amyhoy">@amyhoy</a>) – balancing the success of a product against the scalability of that product and making the hard decisions that are right for the customers. Ouch.
<li><a href="http://www.slideshare.net/twilio/building-a-great-web-api-evan-cooke-qcon-2011">Building a Great Web API</a> (Evan Cooke or Twilio) – includes the valuable line “It should take no more than 5 minutes for a developer to perform a useful task using your API for the first time.&#8221;
<li><a href="http://runpee.com/">RunPee</a> – Ever need to hit the restroom during the movie but worried you’ll miss something? RunPee tells you the slowest point in the movie and lets you know what you’ll miss while you go.
<li><a href="http://stackoverflow.com/questions/11340673/why-does-parseint1-0-19-return-18">Why JavaScript kind of drives me crazy sometimes</a>
<li><a href="http://www.phdcomics.com/comics.php?f=1553">Your Conference Presentation</a> (from PhD Comics)
<li><a href="http://www.coolmomtech.com/2013/01/talk_to_the_hand_bluetooth_gloves.php#more">Bluetooth gloves that work as a head-set for your phone</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://matthiasshapiro.com/2013/02/11/weekly-links-2-11-2012/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using an AdControl in a Trial App (Windows Phone)</title>
		<link>http://matthiasshapiro.com/2013/01/27/using-an-adcontrol-in-a-trial-app-windows-phone/</link>
		<comments>http://matthiasshapiro.com/2013/01/27/using-an-adcontrol-in-a-trial-app-windows-phone/#comments</comments>
		<pubDate>Sun, 27 Jan 2013 10:42:16 +0000</pubDate>
		<dc:creator>matthiasshapiro</dc:creator>
				<category><![CDATA[Windows Phone]]></category>
		<category><![CDATA[AdControl]]></category>
		<category><![CDATA[Trial Mode]]></category>

		<guid isPermaLink="false">http://matthiasshapiro.com/?p=1701</guid>
		<description><![CDATA[<p>I had to search around for this information so I thought it would be nice to have it somewhere handy. Here’s the scenario: You want to put ads into your Windows Phone app, but only when it is in trial &#8230;</p>]]></description>
				<content:encoded><![CDATA[<p>I had to search around for this information so I thought it would be nice to have it somewhere handy. Here’s the scenario: You want to put ads into your Windows Phone app, but only when it is in trial mode.</p>
<p>To start:</p>
<ul>
<li>Download the <a href="http://advertising.microsoft.com/mobile-apps">Microsoft Ads SDK</a></li>
<li>Sign into the <a href="http://pubcenter.microsoft.com">Microsoft pubCenter</a> and add an ad and an application to your account. You will get an ad id and an application id that we’ll use below to display the ads.</li>
</ul>
<h2>Add Permissions for the AdControl</h2>
<p>We need the following permissions set in the WMAppManifest.xml file to get the AdControl to work.</p>
<ul>
<li>ID_CAP_IDENTIFY_USER</li>
<li>ID_CAP_MEDIALIB_PHOTO</li>
<li>ID_CAP_NETWORKING</li>
<li>ID_CAP_PHONEDIALER</li>
<li>ID_CAP_WEBBROWSERCOMPONENT</li>
</ul>
<h2>Add structure for your AdControl</h2>
<p>I decided that the best way to do this was to create a Grid layout with 2 rows. The top row is for all the important stuff in my app and the bottom row is holding my AdControl. The XAML looks something like this:</p>
<pre class="code">&lt;Grid x:Name=&quot;LayoutRoot&quot; &gt;
    &lt;Grid.RowDefinitions&gt;
        &lt;RowDefinition Height=&quot;*&quot;/&gt;
        &lt;RowDefinition Height=&quot;Auto&quot;/&gt;
    &lt;/Grid.RowDefinitions&gt;
    &lt;Grid x:Name=&quot;MyContent&quot;&gt;
        &lt;!-- all my UI goes here --&gt;
    &lt;/Grid&gt;
    &lt;Border x:Name=&quot;AdControlHolder&quot; Grid.Row=&quot;1&quot;&gt;
    &lt;/Border&gt;
&lt;/Grid&gt;</pre>
<h2>Add logic to include the AdControl if we are in trial mode</h2>
<p>If I don’t place anything in my Border control, it will be completely invisible. So what we’re going to do is:</p>
<ol>
<li>Check to see if our app is in a trial mode</li>
<li>If it is, add the AdControl. Otherwise do nothing.</li>
</ol>
<p>The only problem with this is that it can be difficult to test. For one thing, the <a href="http://msdn.microsoft.com/en-us/library/advertising-mobile-windows-phone-test-mode-values%28v=msads.20%29.aspx">AdControl requires some custom parameters</a> to run in a test environment. Additionally, we can’t set the app to “trial mode” in the test environment, so we have to simulate it. I’ve tried to take all this and encapsulate it in a block of code.</p>
<pre class="code">LicenseInformation info = new LicenseInformation();
#if DEBUG
if (true) 
#else
if ( info.IsTrial() ) 
#endif                
{    
    // running in trial mode
    AdControl ac = new AdControl();
#if DEBUG
    ac.AdUnitId = &quot;Image480_80&quot;;
    // or for text ads
    //ac.AdUnitId = &quot;TextAd&quot;;
    // or for smaller ads
    //ac.AdUnitId = &quot;Image300_50&quot;;
    ac.ApplicationId = &quot;test_client&quot;;
#else
ac.AdUnitId = &quot;000000&quot;; // insert your AdUnitId from the pubCenter site
    
    
    // add your ApplicationId from the pubCenter
    ac.ApplicationId = &quot;12345678-1234-1234-1234-123456789012&quot;;
 #endif
    ac.Width = 480;
    ac.Height = 80;
    AdControlHolder.Child = ac;
}</pre>
<p>And that should be good to get started!</p>
]]></content:encoded>
			<wfw:commentRss>http://matthiasshapiro.com/2013/01/27/using-an-adcontrol-in-a-trial-app-windows-phone/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Weekly Links, January 15 2013</title>
		<link>http://matthiasshapiro.com/2013/01/15/weekly-links-january-15-2013/</link>
		<comments>http://matthiasshapiro.com/2013/01/15/weekly-links-january-15-2013/#comments</comments>
		<pubDate>Tue, 15 Jan 2013 18:48:11 +0000</pubDate>
		<dc:creator>matthiasshapiro</dc:creator>
				<category><![CDATA[Weekly Links]]></category>

		<guid isPermaLink="false">http://matthiasshapiro.com/?p=1696</guid>
		<description><![CDATA[<h2>Windows Phone</h2>
<ul>
<li><a href="http://codeiuse.tumblr.com/post/40553978496/limiting-textbox-input-to-integers-in-windows-phone">Limiting TextBox Input To Integers in Windows Phone</a> – Simple enough, but I use it every couple of projects so I thought it should go somewhere I can find it.</li>
<li><a href="http://blog.rajenki.com/2012/12/how-to-add-windows-phone-8-builds-to-your-existing-apps/">Add Windows Phone 8 Builds to your Existing </a></li>&#8230;</ul>]]></description>
				<content:encoded><![CDATA[<h2>Windows Phone</h2>
<ul>
<li><a href="http://codeiuse.tumblr.com/post/40553978496/limiting-textbox-input-to-integers-in-windows-phone">Limiting TextBox Input To Integers in Windows Phone</a> – Simple enough, but I use it every couple of projects so I thought it should go somewhere I can find it.</li>
<li><a href="http://blog.rajenki.com/2012/12/how-to-add-windows-phone-8-builds-to-your-existing-apps/">Add Windows Phone 8 Builds to your Existing Apps</a> (Rajen Kishna <a href="https://twitter.com/rajen_k">@rajen_k</a>) – If you want to support both Windows Phone 8 and Windows Phone 7 AND you want to feature some Windows Phone 8 only features, you’ll need this post.</li>
<li><a href="http://blogs.msdn.com/b/ptorr/archive/2011/07/11/background-agents-part-1-of-3.aspx">Background Agents for Windows Phone (Part 1 of 3)</a> (Peter Torr) – I was working on some periodic task project this last week and Peter’s post was invaluable.</li>
<li><a href="https://msevents.microsoft.com/cui/EventDetail.aspx?culture=nl-NL&amp;EventID=1032541410&amp;IO=31YlshLqrNo1LmwlW%2b8oAw%3d%3d">Windows Phone 8 Camp in Amsterdam</a> – I’ll be speaking at the Windows Phone 8 Camp in the Netherlands this coming Wednesday (January 23). Hope to see you there!</li>
<li><a href="http://blogs.msdn.com/b/uk_faculty_connection/archive/2013/01/11/want-to-pimp-your-windows-phone-8-emulator-well-here-you-go-http-wp8emulatorskins-codeplex-com.aspx">Windows Phone 8 skins for your emulator</a> (Lee Stott <a href="https://twitter.com/lee_stott">@lee_stott</a>) – Will installing a custom skin on your Windows Phone 8 emulator make you a better Windows Phone developer? Yes. And I judge you accordingly.</li>
<li><a href="http://phonegap.com/download/">PhoneGap 2.3.0 is out!</a> – PhoneGap (now has support for Windows Phone 8)</li>
</ul>
<h2>Windows 8</h2>
<ul>
<li><a href="http://msdn.microsoft.com/de-ch/aa570302.aspx?EventID=1032382762">MSDN TechTalk Event: Windows Store apps and games using HTML5, Javascript and CSS</a> (starring Jeff Burtoft <a href="https://twitter.com/boyofgreen">@boyofgreen</a>) – Jeff Burtoft is speaking in Zurich on Windows 8 development in HTML5. You couldn’t ask for a better HTML5 speaker, his knowledge is encyclopedic.</li>
</ul>
<h2>Design, HTML5, and Other</h2>
<ul>
<li><a href="http://www.scirra.com/construct2">Construct2</a> – HTML5 game engine. I’m totally going to get into this… some day…</li>
<li><a href="http://www.blambot.com/font_perihelion.shtml">Perihelion font for $30</a> – a pretty cool font</li>
<li><a href="http://placekitten.com/">PlaceKitten.com</a> – For when you need a kitten placeholder service for your designs</li>
<li><a href="http://onlinelibrary.wiley.com/doi/10.1111/j.1469-8986.2011.01327.x/abstract;jsessionid=A965CBD7C0BDAABA2FECFA7D9350AA37.d02t03?deniedAccessCustomisedMessage=&amp;userIsAuthenticated=false">EEG readings + data crunching = Phenotype patterns in psychotic diagnoses</a> (John Robert Shapiro) – Yeah, I have weird leisure reading (inspired by my neuroscientist brother), but it’s actually some pretty cool EEG research  looking at auditory responses characteristic in psychotic diagnoses (could lead to identifying genetic markers for these conditions).</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://matthiasshapiro.com/2013/01/15/weekly-links-january-15-2013/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Windows Phone ScheduledTask Agents and FileNotFoundException</title>
		<link>http://matthiasshapiro.com/2013/01/11/windows-phone-scheduledtask-agents-and-filenotfoundexception/</link>
		<comments>http://matthiasshapiro.com/2013/01/11/windows-phone-scheduledtask-agents-and-filenotfoundexception/#comments</comments>
		<pubDate>Fri, 11 Jan 2013 22:29:35 +0000</pubDate>
		<dc:creator>matthiasshapiro</dc:creator>
				<category><![CDATA[Windows Phone]]></category>
		<category><![CDATA[FileNotFoundException]]></category>
		<category><![CDATA[PeriodicTask]]></category>
		<category><![CDATA[ScheduledTaskAgent]]></category>

		<guid isPermaLink="false">http://matthiasshapiro.com/?p=1695</guid>
		<description><![CDATA[<p>Maybe this is a problem that I’m all alone on, but it took me some time to figure out.</p>
<p>I started up a ScheduledAgent for Windows Phone so that I could do some updates with a PeriodicTask, but when I &#8230;</p>]]></description>
				<content:encoded><![CDATA[<p>Maybe this is a problem that I’m all alone on, but it took me some time to figure out.</p>
<p>I started up a ScheduledAgent for Windows Phone so that I could do some updates with a PeriodicTask, but when I ran the app, I was getting:</p>
<blockquote><p>FileNotFoundException was unhandled – An unhandled exception of type ‘System.UI.FileNotFoundException’ occurred in System.Windows.ni.dll</p>
</blockquote>
<p>Here’s what happened:</p>
<p>I had initially named my ScheduledTask project something stupid, so I needed to re-name it. I did so by clicking on the project name and renaming it.</p>
<p><a href="http://matthiasshapiro.com/wp-content/uploads/2013/01/image2.png"><img title="image" style="background-image: none; display: inline" border="0" alt="image" src="http://matthiasshapiro.com/wp-content/uploads/2013/01/image_thumb1.png" width="192" height="79"></a></p>
<p>If I had opened the properties section of the project</p>
<p><a href="http://matthiasshapiro.com/wp-content/uploads/2013/01/image3.png"><img title="image" style="background-image: none; display: inline" border="0" alt="image" src="http://matthiasshapiro.com/wp-content/uploads/2013/01/image_thumb2.png" width="344" height="136"></a></p>
<p>I would have seen that my assembly name (which names the actual file we’re looking for) was still the old stupid name</p>
<p><a href="http://matthiasshapiro.com/wp-content/uploads/2013/01/image4.png"><img title="image" style="background-image: none; display: inline" border="0" alt="image" src="http://matthiasshapiro.com/wp-content/uploads/2013/01/image_thumb3.png" width="669" height="118"></a></p>
<p>Once I update this name, I need to go to my WMAppManifest.xml file in my startup project and open it with the text editor.</p>
<pre class="code"><span style="background: white; color: blue">&lt;</span><span style="background: white; color: rgb(163,21,21)">ExtendedTask </span><span style="background: white; color: red">Name</span><span style="background: white; color: blue">=</span><span style="background: white; color: black">"</span><span style="background: white; color: blue">BackgroundTask</span><span style="background: white; color: black">"</span><span style="background: white; color: blue">&gt;
  &lt;</span><span style="background: white; color: rgb(163,21,21)">BackgroundServiceAgent
    </span><span style="background: white; color: red">Specifier</span><span style="background: white; color: blue">=</span><span style="background: white; color: black">"</span><span style="background: white; color: blue">ScheduledTaskAgent</span><span style="background: white; color: black">"
    </span><span style="background: white; color: red">Name</span><span style="background: white; color: blue">=</span><span style="background: white; color: black">"</span><span style="background: white; color: blue">MyAwesomeTask</span><span style="background: white; color: black">"
    </span><span style="background: white; color: red">Source</span><span style="background: white; color: blue">=</span><span style="background: white; color: black">"</span><span style="background: white; color: blue">MyScheduledTask</span><span style="background: white; color: black">"
    </span><span style="background: white; color: red">Type</span><span style="background: white; color: blue">=</span><span style="background: white; color: black">"</span><span style="background: white; color: blue">MyScheduledTask.ScheduledAgent</span><span style="background: white; color: black">" </span><span style="background: white; color: blue">/&gt;
&lt;/</span><span style="background: white; color: rgb(163,21,21)">ExtendedTask</span><span style="background: white; color: blue">&gt;</span></pre>
<p>It took me some time to figure out what the parameters in the BackgroundServiceAgent meant so:</p>
<p><strong>Specifier</strong> – ScheduledTaskAgent</p>
<p><strong>Name</strong> – the string name you give your task when you start it. In the example below, it would be Name=MyAwesomeTask: </p>
<pre class="code"><span style="background: white; color: rgb(43,145,175)">PeriodicTask </span><span style="background: white; color: black">myPeriodicTask = </span><span style="background: white; color: blue">new </span><span style="background: white; color: rgb(43,145,175)">PeriodicTask</span><span style="background: white; color: black">(</span><span style="background: white; color: rgb(163,21,21)">"MyAwesomeTask"</span><span style="background: white; color: black">);
</span><span style="background: white; color: rgb(43,145,175)">ScheduledActionService</span><span style="background: white; color: black">.Add(myPeriodicTask);</span></pre>
<p><strong>Source</strong> – the name of the DLL that holds your task code. This is determined in the Assembly name box you see in the properties section of your csproj.</p>
<p><strong>Type</strong> – the namespace.type notation that points to the actual object (which must inherit from ScheduledTaskAgent)</p>
]]></content:encoded>
			<wfw:commentRss>http://matthiasshapiro.com/2013/01/11/windows-phone-scheduledtask-agents-and-filenotfoundexception/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
