<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
  version="2.0">
  <channel>
    <title>Appsmash</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/matthiasshapiro/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/matthiasshapiro/feed.xml</link>
    <description>Windows Phone Apps from Concept To Reality</description>
    <lastBuildDate>Wed, 17 Apr 2019 03:23:31 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>Using Offline Maps in Windows Phone 8</title>
      <link>https://docs.microsoft.com/archive/blogs/matthiasshapiro/using-offline-maps-in-windows-phone-8</link>
      <pubDate>Fri, 14 Jun 2013 01:29:00 GMT</pubDate>
      <dc:creator><![CDATA[MatthiasShapiroExt]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/matthiasshapiro/2013/06/14/using-offline-maps-in-windows-phone-8/</guid>
      <description><![CDATA[This is a support post for the Inside Windows Phone show on location and mapping in Windows Phone 8...]]></description>
      <content:encoded><![CDATA[<p>This is a support post for the <a href="https://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"><span style="background: white; color: rgb(43, 145, 175);">MapDownloaderTask </span><span style="background: white; color: black;">mdt = </span><span style="background: white; color: blue;">new </span><span style="background: white; color: rgb(43, 145, 175);">MapDownloaderTask</span><span style="background: white; color: black;">();
mdt.Show();</span></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>
    </item>
    <item>
      <title>Finding and Mapping a Route in Windows Phone 8</title>
      <link>https://docs.microsoft.com/archive/blogs/matthiasshapiro/finding-and-mapping-a-route-in-windows-phone-8</link>
      <pubDate>Fri, 14 Jun 2013 00:46:00 GMT</pubDate>
      <dc:creator><![CDATA[MatthiasShapiroExt]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/matthiasshapiro/2013/06/14/finding-and-mapping-a-route-in-windows-phone-8/</guid>
      <description><![CDATA[This is a support post for the Inside Windows Phone show on location and mapping in Windows Phone 8...]]></description>
      <content:encoded><![CDATA[<p>This is a support post for the <a href="https://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"><span style="background: white; color: blue;">&lt;</span><span style="background: white; color: rgb(163, 21, 21);">maps</span><span style="background: white; color: blue;">:</span><span style="background: white; color: rgb(163, 21, 21);">Map </span><span style="background: white; color: red;">x</span><span style="background: white; color: blue;">:</span><span style="background: white; color: red;">Name</span><span style="background: white; color: blue;">=&quot;myMap&quot; </span><span style="background: white; color: blue;">/&gt;</span></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"><span style="background: white; color: rgb(43, 145, 175);">List</span><span style="background: white; color: black;">&lt;</span><span style="background: white; color: rgb(43, 145, 175);">GeoCoordinate</span><span style="background: white; color: black;">&gt; wayPoints = </span><span style="background: white; color: blue;">new </span><span style="background: white; color: rgb(43, 145, 175);">List</span><span style="background: white; color: black;">&lt;</span><span style="background: white; color: rgb(43, 145, 175);">GeoCoordinate</span><span style="background: white; color: black;">&gt;();
wayPoints.Add(</span><span style="background: white; color: blue;">new </span><span style="background: white; color: rgb(43, 145, 175);">GeoCoordinate</span><span style="background: white; color: black;">(47.60887, -122.34094));
wayPoints.Add(</span><span style="background: white; color: blue;">new </span><span style="background: white; color: rgb(43, 145, 175);">GeoCoordinate</span><span style="background: white; color: black;">(47.6396, -122.1300)); </span></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"><span style="background: white; color: rgb(43, 145, 175);">RouteQuery </span><span style="background: white; color: black;">routeQuery = </span><span style="background: white; color: blue;">new </span><span style="background: white; color: rgb(43, 145, 175);">RouteQuery</span><span style="background: white; color: black;">();
routeQuery.QueryCompleted += routeQuery_QueryCompleted;
routeQuery.TravelMode = </span><span style="background: white; color: rgb(43, 145, 175);">TravelMode</span><span style="background: white; color: black;">.Walking;                    
routeQuery.Waypoints = wayPoints;
routeQuery.QueryAsync();</span></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"><span style="background: white; color: blue;">void </span><span style="background: white; color: black;">routeQuery_QueryCompleted(</span><span style="background: white; color: blue;">object </span><span style="background: white; color: black;">sender, </span><span style="background: white; color: rgb(43, 145, 175);">QueryCompletedEventArgs</span><span style="background: white; color: black;">&lt;</span><span style="background: white; color: rgb(43, 145, 175);">Route</span><span style="background: white; color: black;">&gt; e)
{
    </span><span style="background: white; color: blue;">if </span><span style="background: white; color: black;">(</span><span style="background: white; color: blue;">null </span><span style="background: white; color: black;">== e.Error)
    {
        </span><span style="background: white; color: rgb(43, 145, 175);">Route </span><span style="background: white; color: black;">MyRoute = e.Result;
</span><span style="background: white; color: black;">    }
}</span></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"><span style="background: white; color: rgb(43, 145, 175);">Route </span><span style="background: white; color: black;">MyRoute = e.Result;
</span><span style="background: white; color: rgb(43, 145, 175);">MapRoute </span><span style="background: white; color: black;">mappedRoute = </span><span style="background: white; color: blue;">new </span><span style="background: white; color: rgb(43, 145, 175);">MapRoute</span><span style="background: white; color: black;">(MyRoute);
scavangeMap.AddRoute(<span style="background: white; color: black;">mappedRoute</span>);
scavangeMap.SetView(<span style="background: white; color: black;">mappedRoute</span>.Route.BoundingBox);</span></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>
    </item>
    <item>
      <title>Reverse Geocoding in Windows Phone 8</title>
      <link>https://docs.microsoft.com/archive/blogs/matthiasshapiro/reverse-geocoding-in-windows-phone-8</link>
      <pubDate>Fri, 14 Jun 2013 00:14:00 GMT</pubDate>
      <dc:creator><![CDATA[MatthiasShapiroExt]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/matthiasshapiro/2013/06/14/reverse-geocoding-in-windows-phone-8/</guid>
      <description><![CDATA[This is a support post for the Inside Windows Phone show on location and mapping in Windows Phone 8...]]></description>
      <content:encoded><![CDATA[<p>This is a support post for the <a href="https://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"><span style="background: white; color: blue;">using </span><span style="background: white; color: black;">Microsoft.Phone.Maps.Services;</span></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"><span style="background: white; color: rgb(43, 145, 175);">ReverseGeocodeQuery </span><span style="background: white; color: black;">reverseGeocode = </span><span style="background: white; color: blue;">new </span><span style="background: white; color: rgb(43, 145, 175);">ReverseGeocodeQuery</span><span style="background: white; color: black;">();
</span><span style="background: white; color: black;">reverseGeocode.GeoCoordinate = </span><span style="background: white; color: blue;">new </span><span style="background: white; color: rgb(43, 145, 175);">GeoCoordinate</span><span style="background: white; color: black;">(47.60887, -122.34094);
reverseGeocode.QueryCompleted += reverseGeocode_QueryCompleted;
reverseGeocode.QueryAsync();</span></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"><span style="background: white; color: blue;">void </span><span style="background: white; color: black;">reverseGeocode_QueryCompleted(</span><span style="background: white; color: blue;">object </span><span style="background: white; color: black;">sender, </span><span style="background: white; color: rgb(43, 145, 175);">QueryCompletedEventArgs</span><span style="background: white; color: black;">&lt;</span><span style="background: white; color: rgb(43, 145, 175);">IList</span><span style="background: white; color: black;">&lt;</span><span style="background: white; color: rgb(43, 145, 175);">MapLocation</span><span style="background: white; color: black;">&gt;&gt; e)
{
    </span><span style="background: white; color: rgb(43, 145, 175);">MapAddress </span><span style="background: white; color: black;">geoAddress = e.Result[0].Information.Address;           
}</span></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="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/55/32/metablogapi/0245.image_326912E9.png" original-url="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="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/55/32/metablogapi/3872.image_thumb_5217ECB1.png" original-url="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>
    </item>
    <item>
      <title>Calculating Distance From 2 GeoCoordinates in Windows Phone 8</title>
      <link>https://docs.microsoft.com/archive/blogs/matthiasshapiro/calculating-distance-from-2-geocoordinates-in-windows-phone-8</link>
      <pubDate>Thu, 13 Jun 2013 23:45:00 GMT</pubDate>
      <dc:creator><![CDATA[MatthiasShapiroExt]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/matthiasshapiro/2013/06/13/calculating-distance-from-2-geocoordinates-in-windows-phone-8/</guid>
      <description><![CDATA[This is a support post for the Inside Windows Phone show on location and mapping in Windows Phone 8...]]></description>
      <content:encoded><![CDATA[<p>This is a support post for the <a href="https://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"><span style="background: white; color: blue;">&lt;</span><span style="background: white; color: rgb(163, 21, 21);">maps</span><span style="background: white; color: blue;">:</span><span style="background: white; color: rgb(163, 21, 21);">Map </span><span style="background: white; color: red;">x</span><span style="background: white; color: blue;">:</span><span style="background: white; color: red;">Name</span><span style="background: white; color: blue;">=&quot;myMap&quot; </span><span style="background: white; color: red;">Tap</span><span style="background: white; color: blue;">=&quot;ReadMapTap&quot; /&gt;</span></pre>


<p>And then translate the tap location into a GeoCoordinate like so:</p>

<pre class="code"><span style="background: white; color: blue;">void </span><span style="background: white; color: black;">ReadMapTap(</span><span style="background: white; color: blue;">object </span><span style="background: white; color: black;">sender, System.Windows.Input.</span><span style="background: white; color: rgb(43, 145, 175);">GestureEventArgs </span><span style="background: white; color: black;">e)
{
    </span><span style="background: white; color: rgb(43, 145, 175);">GeoCoordinate </span><span style="background: white; color: black;">tapLocation = <br />         </span><span style="background: white; color: black;">distanceMap.ConvertViewportPointToGeoCoordinate(e.GetPosition((</span><span style="background: white; color: rgb(43, 145, 175);">UIElement</span><span style="background: white; color: black;">)sender));
}</span></pre>


<p>Then we just create another GeoCoordinate, like maybe Microsoft campus:</p>

<pre class="code"><span style="background: white; color: rgb(43, 145, 175);">GeoCoordinate </span><span style="background: white; color: black;">Msft = </span><span style="background: white; color: blue;">new </span><span style="background: white; color: rgb(43, 145, 175);">GeoCoordinate</span><span style="background: white; color: black;">(47.6396, -122.1300);</span></pre>


<p>And just ask one of our GeoCoordinates how far it is to the other one. </p>

<pre class="code"><span style="background: white; color: blue;">double </span><span style="background: white; color: black;">distanceToMSFT = tapLocation.GetDistanceTo(Msft);
</span><span style="background: white; color: rgb(43, 145, 175);">MessageBox</span><span style="background: white; color: black;">.Show(</span><span style="background: white; color: rgb(163, 21, 21);">&quot;It is &quot; </span><span style="background: white; color: black;">+ distanceToMSFT.ToString() + </span><span style="background: white; color: rgb(163, 21, 21);">&quot; meters from there to Microsoft!&quot;</span><span style="background: white; color: black;">);
</span></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>
    </item>
    <item>
      <title>10 Great Windows Phone 8 Code Samples (No, Wait… 30)</title>
      <link>https://docs.microsoft.com/archive/blogs/matthiasshapiro/10-great-windows-phone-8-code-samples-no-wait-30</link>
      <pubDate>Thu, 21 Mar 2013 13:18:00 GMT</pubDate>
      <dc:creator><![CDATA[MatthiasShapiroExt]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/matthiasshapiro/2013/03/21/10-great-windows-phone-8-code-samples-no-wait-30/</guid>
      <description><![CDATA[Sometimes we don’t want to read a blog posts on a topic, we want to look at the code implementing...]]></description>
      <content:encoded><![CDATA[<p>Sometimes we don’t want to read a blog posts on a topic, we want to look at the code implementing it. Working code cuts through the confusion and explanations and gets us to the heart of the things we want to do. That’s why we should be familiar with the <a href="http://code.msdn.microsoft.com/site/search?f%5B1%5D.Value=Windows%20Phone%208">wealth of samples available for Windows Phone on MSDN</a>.</p>  <p>There are a lot of very cool samples on MSDN covering a lot of topics. As I went through them I was so inspired, I thought a visual of the samples would be a great way to help navigate them. So I selected 30 of my favorite sample and put together this chart showing how the samples walk through different Windows Phone 8 features and technologies. </p>  <p><a href="http://wp8samples.azurewebsites.net/WP8_Samples.html"><img title="image" style="display: inline; background-image: none;" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/55/32/metablogapi/1602.image_50E38B4B.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-55-32-metablogapi/1602.image_5F00_50E38B4B.png" width="488" height="282" /></a></p>  <p>(click for interactive version)</p>  <p>This isn’t to say there are only 30 good samples on MSDN. But I had to make a cut-off somewhere before I ended up with more information than I could reasonable show on a screen. </p>  <p>You can also download a <a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/55/32/metablogapi/1602.image_50E38B4B.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-55-32-metablogapi/1602.image_5F00_50E38B4B.png">larger static version of this graph here</a></p>  <p>I also wanted to highlight 10 of my favorite samples from that chart.</p>  <h2>10) <a href="http://code.msdn.microsoft.com/URI-Association-Sample-7915a233">URI Association and NFC</a>&#160;</h2>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/55/32/metablogapi/7571.wp_ss_20130320_0007_098E3559.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-55-32-metablogapi/7571.wp_5F00_ss_5F00_20130320_5F00_0007_5F00_098E3559.png"><img title="wp_ss_20130320_0007" style="display: inline; background-image: none;" border="0" alt="wp_ss_20130320_0007" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/55/32/metablogapi/1033.wp_ss_20130320_0007_thumb_026EF8E1.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-55-32-metablogapi/1033.wp_5F00_ss_5F00_20130320_5F00_0007_5F00_thumb_5F00_026EF8E1.png" width="148" height="244" /></a>&#160;&#160;&#160;&#160; <a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/55/32/metablogapi/0537.wp_ss_20130320_0005_3466996B.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-55-32-metablogapi/0537.wp_5F00_ss_5F00_20130320_5F00_0005_5F00_3466996B.png"><img title="wp_ss_20130320_0005" style="display: inline; background-image: none;" border="0" alt="wp_ss_20130320_0005" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/55/32/metablogapi/8551.wp_ss_20130320_0005_thumb_144B8CAE.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-55-32-metablogapi/8551.wp_5F00_ss_5F00_20130320_5F00_0005_5F00_thumb_5F00_144B8CAE.png" width="148" height="244" /></a></p>  <p>In Windows Phone 8 there are so many opportunities for our apps to connect outside of the sandbox. This sample looks at one of the ways we can launch our apps: URI Associations. We just register our app to handle the appropriate association and when the user hits a link with that association, it launches our app. Unless, of course, our app isn’t installed. If that’s the case, it goes to find out app. </p>  <p>This sample includes 3 projects so we can see all the options available with URI associations including simple app launching, selecting multiple apps from a list and NFC app launching.</p>  <h2>9) <a href="http://code.msdn.microsoft.com/PhotoHub-Windows-Phone-8-fd7a1093">LongListSelector PhotoHub</a></h2>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/55/32/metablogapi/5811.image_221DD2A9.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-55-32-metablogapi/5811.image_5F00_221DD2A9.png"><img title="image" style="margin: 0px; display: inline; background-image: none;" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/55/32/metablogapi/8547.image_thumb_61E7B92E.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-55-32-metablogapi/8547.image_5F00_thumb_5F00_61E7B92E.png" width="149" height="244" /></a>&#160;&#160;&#160;&#160; <a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/55/32/metablogapi/0118.image_08B5CF6F.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-55-32-metablogapi/0118.image_5F00_08B5CF6F.png"><img title="image" style="margin: 0px; display: inline; background-image: none;" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/55/32/metablogapi/7065.image_thumb_53A9403E.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-55-32-metablogapi/7065.image_5F00_thumb_5F00_53A9403E.png" width="148" height="244" /></a></p>  <p>LongListSelector is a new control in Windows Phone 8 and the preferred control for showing big lists. But using it appropriately requires a little bit of practice and maybe a good sample or two. This sample shows how to use the LongListSelector with a large sorted group or photos. It includes an example of styling and templating with JumpListStyle, and GroupHeaderTemplate. Be sure to check out the companion sample <a href="http://code.msdn.microsoft.com/PeopleHub-Windows-Phone-80-88abe94d">LongListSelector PeopleHub</a>.</p>  <h2>8) <a href="http://code.msdn.microsoft.com/TwitterSearch-Windows-b7fc4e5e">LongListSelector Infininte Scrolling (With Twitter)</a>&#160;</h2>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/55/32/metablogapi/6087.wp_ss_20130320_0004_338E3381.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-55-32-metablogapi/6087.wp_5F00_ss_5F00_20130320_5F00_0004_5F00_338E3381.png"><img title="wp_ss_20130320_0004" style="display: inline; background-image: none;" border="0" alt="wp_ss_20130320_0004" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/55/32/metablogapi/0216.wp_ss_20130320_0004_thumb_6F4DCC34.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-55-32-metablogapi/0216.wp_5F00_ss_5F00_20130320_5F00_0004_5F00_thumb_5F00_6F4DCC34.png" width="148" height="244" /></a></p>  <p>Another LongListSelector sample, but this really is an important concept in Windows Phone 8. What I love about this one is that it deals with a common scenario: Load a pile of data, let the user scroll and load more when they hit the bottom of the current list. In addition to that, it is a scrolling list with images, so we can see the preferred way to do background image loading for a really rich, smooth experience.</p>  <h2>7) <a href="http://code.msdn.microsoft.com/wpapps/Visual-Studio-3D-Starter-455a15f1">Visual Studio 3D Starter Kit</a></h2>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/55/32/metablogapi/6153.image_4F32BF77.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-55-32-metablogapi/6153.image_5F00_4F32BF77.png"><img title="image" style="margin: 0px; display: inline; background-image: none;" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/55/32/metablogapi/4010.image_thumb_1A263047.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-55-32-metablogapi/4010.image_5F00_thumb_5F00_1A263047.png" width="149" height="244" /></a></p>  <p>With Windows Phone 8, we support native code with an eye toward creating the most compelling gaming experiences on any mobile platform. This project is a great sampler of implemented features. Loading and rendering assets, animated meshes, 2D XAML HUD, shaders and some game logic make this a great intro to making games for Windows Phone8. As a bonus, it also can serve as a starting point for creating a Direct3D game with shared code between Windows Store (Windows 8) and Windows Phone 8 games.</p>  <h2>6) <a href="http://code.msdn.microsoft.com/Speech-for-Windows-Phone-3771fc6d">Speech Recognition Using a Custom Grammar</a></h2>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/55/32/metablogapi/7462.wp_ss_20130321_00021_7A0B2389.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-55-32-metablogapi/7462.wp_5F00_ss_5F00_20130321_5F00_00021_5F00_7A0B2389.png"><img title="wp_ss_20130321_00021" style="display: inline; background-image: none;" border="0" alt="wp_ss_20130321_00021" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/55/32/metablogapi/5327.wp_ss_20130321_00021_thumb_07DD6985.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-55-32-metablogapi/5327.wp_5F00_ss_5F00_20130321_5F00_00021_5F00_thumb_5F00_07DD6985.png" width="139" height="244" /></a>&#160;&#160;&#160;&#160; <a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/55/32/metablogapi/6888.wp_ss_20130321_00031_39D50A0F.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-55-32-metablogapi/6888.wp_5F00_ss_5F00_20130321_5F00_00031_5F00_39D50A0F.png"><img title="wp_ss_20130321_00031" style="display: inline; background-image: none;" border="0" alt="wp_ss_20130321_00031" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/55/32/metablogapi/4745.wp_ss_20130321_00031_thumb_47A7500A.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-55-32-metablogapi/4745.wp_5F00_ss_5F00_20130321_5F00_00031_5F00_thumb_5F00_47A7500A.png" width="139" height="244" /></a></p>  <p>Easy Speech recognition and synthesis APIs in Windows Phone 8 make speech one of my favorite new features. But the first question is always “Does speech recognition work when the phone is offline?” to which my answer is “Windows Phone speech is as functional offline as Siri is when on your phone is online.&quot; (Get it! It’s OK to laugh.) But that’s not actually very fair because Windows Phone speech is still pretty useful offline due to the ability to implement custom grammars that let the phone recognize a defined vocabulary of words. </p>  <p>This sample shows how to create a custom grammar and do speech recognition while suppressing the default speech recognition UI. It’s a powerful example.</p>  <h2>5) <a href="http://code.msdn.microsoft.com/Wallet-membership-and-f5ffee3a">Wallet membership and deals</a>&#160;</h2>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/55/32/metablogapi/1682.image_278C434D.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-55-32-metablogapi/1682.image_5F00_278C434D.png"><img title="image" style="margin: 0px; display: inline; background-image: none;" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/55/32/metablogapi/1106.image_thumb_727FB41C.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-55-32-metablogapi/1106.image_5F00_thumb_5F00_727FB41C.png" width="148" height="244" /></a>&#160;&#160;&#160;&#160; <a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/55/32/metablogapi/7043.image_3968D71A.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-55-32-metablogapi/7043.image_5F00_3968D71A.png"><img title="image" style="margin: 0px; display: inline; background-image: none;" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/55/32/metablogapi/5808.image_thumb_473B1D15.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-55-32-metablogapi/5808.image_5F00_thumb_5F00_473B1D15.png" width="149" height="244" /></a></p>  <p>The Wallet APIs in Windows Phone are a really powerful way to connect your app to the user’s Wallet experience. This sample shows how to manage a custom membership card, connect it to the Wallet, and let the user select coupons to add to their Wallet. It’s a great demo for a feature that doesn’t get nearly the attention it deserves.</p>  <h2>4) <a href="http://code.msdn.microsoft.com/wpapps/Windows-Phone-8-Networking-835239c1">Windows Phone 8 Networking Samples</a></h2>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/55/32/metablogapi/3755.image_7932BD9F.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-55-32-metablogapi/3755.image_5F00_7932BD9F.png"><img title="image" style="margin: 0px; display: inline; background-image: none;" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/55/32/metablogapi/2350.image_thumb_0705039B.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-55-32-metablogapi/2350.image_5F00_thumb_5F00_0705039B.png" width="148" height="244" /></a>&#160;&#160;&#160;&#160; <a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/55/32/metablogapi/0216.image_4DEE2698.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-55-32-metablogapi/0216.image_5F00_4DEE2698.png"><img title="image" style="margin: 0px; display: inline; background-image: none;" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/55/32/metablogapi/6153.image_thumb_2DD319DB.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-55-32-metablogapi/6153.image_5F00_thumb_5F00_2DD319DB.png" width="150" height="244" /></a></p>  <p>This is a wide ranging sample covering socket connections, NFC tag writing, NFC device-to-device connections, data downloads, and (most importantly) Bluetooth connections to the Lego Mindstorms NXTCar. </p>  <h2>3) <a href="http://code.msdn.microsoft.com/ChatterBox-VoIP-sample-app-b1e63b8b">Chatterbox VoIP Sample App</a></h2>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/55/32/metablogapi/1205.image_0DB80D1E.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-55-32-metablogapi/1205.image_5F00_0DB80D1E.png"><img title="image" style="margin: 0px; display: inline; background-image: none;" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/55/32/metablogapi/5305.image_thumb_3FAFADA8.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-55-32-metablogapi/5305.image_5F00_thumb_5F00_3FAFADA8.png" width="148" height="244" /></a>&#160;&#160;&#160;&#160; <a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/55/32/metablogapi/4722.wp_ss_20130321_0002_1F94A0EB.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-55-32-metablogapi/4722.wp_5F00_ss_5F00_20130321_5F00_0002_5F00_1F94A0EB.png"><img title="wp_ss_20130321_0002" style="display: inline; background-image: none;" border="0" alt="wp_ss_20130321_0002" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/55/32/metablogapi/8055.wp_ss_20130321_0002_thumb_5F5E8770.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-55-32-metablogapi/8055.wp_5F00_ss_5F00_20130321_5F00_0002_5F00_thumb_5F00_5F5E8770.png" width="148" height="244" /></a></p>  <p>Under “little-known-features” a lot of people don’t know that Windows Phone 8 not only supports VoIP calls from your app using native APIs but offers to developers the use of default UI paradigms for making and receiving calls. Add to this the ability to run these calls in the background (just like any phone call) and it’s a powerful addition to our development toolbox. This sample goes through </p>  <h2>2) <a href="http://code.msdn.microsoft.com/Basic-Lens-sample-359fda1b">Basic Lens App</a></h2>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/55/32/metablogapi/6472.wp_ss_20130321_0005_115627FB.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-55-32-metablogapi/6472.wp_5F00_ss_5F00_20130321_5F00_0005_5F00_115627FB.png"><img title="wp_ss_20130321_0005" style="display: inline; background-image: none;" border="0" alt="wp_ss_20130321_0005" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/55/32/metablogapi/4338.wp_ss_20130321_0005_thumb_7F0D6138.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-55-32-metablogapi/4338.wp_5F00_ss_5F00_20130321_5F00_0005_5F00_thumb_5F00_7F0D6138.png" width="244" height="148" /></a>&#160;&#160;&#160;&#160; <a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/55/32/metablogapi/0216.wp_ss_20130321_0004_5EF2547B.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-55-32-metablogapi/0216.wp_5F00_ss_5F00_20130321_5F00_0004_5F00_5EF2547B.png"><img title="wp_ss_20130321_0004" style="display: inline; background-image: none;" border="0" alt="wp_ss_20130321_0004" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/55/32/metablogapi/8228.wp_ss_20130321_0004_thumb_7781F1CB.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-55-32-metablogapi/8228.wp_5F00_ss_5F00_20130321_5F00_0004_5F00_thumb_5F00_7781F1CB.png" width="244" height="148" /></a></p>  <p>Creating a Lens application means being part of an exclusive club of apps that do awesome things with the camera. By integrating our app with the default camera app through the Lens feature, our apps can become true extensions of the platform. This sample not only gives a complete implementation of Lens integration, but a complete implementation of a full-featured photo app. It has transition animations, UI for user focus, camera hardware button functionality, and PhotoHub integration. It’s a really powerful sample and a great place to start if you’re building a photo app for Windows Phone.</p>  <h2>1) <a href="http://code.msdn.microsoft.com/Photo-Extensibility-Sample-db289044">Photo Extensibility</a></h2>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/55/32/metablogapi/1185.wp_ss_20130321_0008_5766E50E.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-55-32-metablogapi/1185.wp_5F00_ss_5F00_20130321_5F00_0008_5F00_5766E50E.png"><img title="wp_ss_20130321_0008" style="margin: 0px; display: inline; background-image: none;" border="0" alt="wp_ss_20130321_0008" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/55/32/metablogapi/8032.wp_ss_20130321_0008_thumb_451E1E4C.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-55-32-metablogapi/8032.wp_5F00_ss_5F00_20130321_5F00_0008_5F00_thumb_5F00_451E1E4C.png" width="148" height="244" /></a>&#160;&#160;&#160;&#160; <a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/55/32/metablogapi/1273.wp_ss_20130321_0009_0C07414A.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-55-32-metablogapi/1273.wp_5F00_ss_5F00_20130321_5F00_0009_5F00_0C07414A.png"><img title="wp_ss_20130321_0009" style="display: inline; background-image: none;" border="0" alt="wp_ss_20130321_0009" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/55/32/metablogapi/2744.wp_ss_20130321_0009_thumb_4FDB75A1.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-55-32-metablogapi/2744.wp_5F00_ss_5F00_20130321_5F00_0009_5F00_thumb_5F00_4FDB75A1.png" width="148" height="244" /></a></p>  <p>Some of the samples have names that don’t really give a good idea of how awesome they are. Photo Extensibility is one of those samples. The truth is that extensibility is one of the most powerful developer features of Windows Phone 8 and this sample shows that power. It shows how to launch your pictures app from pretty much anywhere. Launch your app from the PhotoHub, using the share or edit or apps options on every photo, and how to add “captured by [your app name here]” rich media link on photos captured using your app. By implementing these extensions on your photo app you can make your app the center of they user’s mobile photo experience, which is a pretty exciting proposition.</p>]]></content:encoded>
    </item>
    <item>
      <title>Missing OpenStreamForWriteAsync on my StorageFile</title>
      <link>https://docs.microsoft.com/archive/blogs/matthiasshapiro/missing-openstreamforwriteasync-on-my-storagefile</link>
      <pubDate>Tue, 12 Mar 2013 15:09:33 GMT</pubDate>
      <dc:creator><![CDATA[MatthiasShapiroExt]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/matthiasshapiro/2013/03/12/missing-openstreamforwriteasync-on-my-storagefile/</guid>
      <description><![CDATA[I have a sample that I use when serializing data in order to save it to a StorageFile in Windows 8...]]></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: rgb(43, 145, 175);">StorageFile </span><span style="background: white; color: black;">kittenFile = </span><span style="background: white; color: blue;">await </span><span style="background: white; color: rgb(43, 145, 175);">ApplicationData</span><span style="background: white; color: black;">.Current.LocalFolder.CreateFileAsync(</span><span style="background: white; color: rgb(163, 21, 21);">&quot;Kittens4Ever.kittens&quot;</span><span style="background: white; color: black;">, </span><span style="background: white; color: rgb(43, 145, 175);">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: rgb(43, 145, 175);">DataContractSerializer </span><span style="background: white; color: black;">kittenSerial = </span><span style="background: white; color: blue;">new </span><span style="background: white; color: rgb(43, 145, 175);">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: rgb(43, 145, 175);">ObservableCollection</span><span style="background: white; color: black;">&lt;</span><span style="background: white; color: rgb(43, 145, 175);">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>&#160;</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>
    </item>
    <item>
      <title>Getting Started With Windows Phone 8 HTML5 Apps</title>
      <link>https://docs.microsoft.com/archive/blogs/matthiasshapiro/getting-started-with-windows-phone-8-html5-apps</link>
      <pubDate>Fri, 15 Feb 2013 11:35:56 GMT</pubDate>
      <dc:creator><![CDATA[MatthiasShapiroExt]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/matthiasshapiro/2013/02/15/getting-started-with-windows-phone-8-html5-apps/</guid>
      <description><![CDATA[I’ve recently been learning to write HTML 5 / Javascript apps for Windows 8 and wanted to take some...]]></description>
      <content:encoded><![CDATA[I’ve recently been learning to write HTML 5 / Javascript apps for Windows 8 and wanted to take some of that knowledge and transfer it over to Windows Phone 8. As I did so, I learned there are a lot of little “tweaks” that I needed to do to get things working so I thought I’d share those in a post.

If you’d like to follow along, I’m basically just tweaking and adding bits and pieces to the default HTML project available when you’ve installed the <a href="http://dev.windowsphone.com/en-us/downloadsdk">Windows Phone 8 SDK.</a>

You can also <a href="http://matthiasshapiro.com/wp-content/uploads/2012/11/Tutorial_HTML_Project.zip">download the project with all these examples imeplemented</a>.

First of all, one thing I found was that I need to turn on IsScriptEnabled in the WebBrowser control in our MainPage.xaml.
<pre class="code"><span style="background: white; color: blue;">&lt;</span><span style="background: white; color: #a31515;">phone</span><span style="background: white; color: blue;">:</span><span style="background: white; color: #a31515;">WebBrowser </span><span style="background: white; color: red;">x</span><span style="background: white; color: blue;">:</span><span style="background: white; color: red;">Name</span><span style="background: white; color: blue;">="Browser" </span><span style="background: white; color: red;">IsScriptEnabled</span><span style="background: white; color: blue;">="True" /&gt;</span></pre>
The template does this, but in the code behind and only after loading the content. We want to run all the Javascript right off the bat so we IsScriptEnabled to be turned on.
<h3>Turn Scrolling On or Off</h3>
Now we need to decide if we want our HTML app to scroll. In many cases (creating simple HTML content apps) it makes sense to have the app scroll. If this is your scenario, you're in luck... you have to do nothing.

But in many other cases you might want to turn off scrolling. If you're creating a game or you want your user to be able to use touch events in a very rich way. In this scenario, you can either <a href="http://www.scottlogic.co.uk/blog/colin/2011/11/suppressing-zoom-and-scroll-interactions-in-the-windows-phone-7-browser-control/">turn off scrolling the hard way (also known as the Windows Phone 7 compatible way)</a> or the easy way, which is to go into your phone.css and add:
<pre class="code"><span style="background: white; color: maroon;">body </span><span style="background: white; color: black;">{ </span><span style="background: white; color: red;">-ms-touch-action</span><span style="background: white; color: black;">:</span><span style="background: white; color: blue;">none</span><span style="background: white; color: black;">; }</span></pre>
That takes care of some of our initial setup. Now let’s run some Javascript. We can run Javascript a couple ways.
<h3>Javascript: TheTraditional Way</h3>
This way we focus entirely on HTML/JS. So if we give our page title an id:
<pre class="code"><span style="background: white; color: blue;">&lt;</span><span style="background: white; color: maroon;">p </span><span style="background: white; color: red;">id</span><span style="background: white; color: blue;">="dynamicTitle"&gt;</span><span style="background: white; color: black;">page title</span><span style="background: white; color: blue;">&lt;/</span><span style="background: white; color: maroon;">p</span><span style="background: white; color: blue;">&gt;</span></pre>
and then we add a script to change that title
<pre class="code"><span style="background: white; color: blue;">&lt;</span><span style="background: white; color: maroon;">script </span><span style="background: white; color: red;">type</span><span style="background: white; color: blue;">="text/javascript"&gt; 
</span><span style="background: white; color: black;"> document.getElementById(</span><span style="background: white; color: #a31515;">'dynamicTitle'</span><span style="background: white; color: black;">).innerHTML = </span><span style="background: white; color: #a31515;">"running javascript"; 
</span><span style="background: white; color: blue;">&lt;/</span><span style="background: white; color: maroon;">script</span><span style="background: white; color: blue;">&gt;</span></pre>
we’ll see that text updated at runtime. Super easy.
<h3>Run Javascript Function From C#</h3>
We can also add a function to our HTML or Javascript files, but leave it up to our C# file to run that script. In this case we would add a function like so:
<pre class="code"><span style="background: white; color: blue;">&lt;</span><span style="background: white; color: maroon;">script </span><span style="background: white; color: red;">type</span><span style="background: white; color: blue;">="text/javascript"&gt;
 function </span><span style="background: white; color: black;">changeTitle() { 
 document.getElementById(</span><span style="background: white; color: #a31515;">'dynamicTitle'</span><span style="background: white; color: black;">).innerHTML = </span><span style="background: white; color: #a31515;">"function initiated in C#"</span><span style="background: white; color: black;">; 
 }

 </span><span style="background: white; color: blue;">function </span><span style="background: white; color: black;">changeTitle(someNewText) { 
 document.getElementById(</span><span style="background: white; color: #a31515;">'dynamicTitle'</span><span style="background: white; color: black;">).innerHTML = someNewText; 
 } 
</span><span style="background: white; color: blue;">&lt;/</span><span style="background: white; color: maroon;">script</span><span style="background: white; color: blue;">&gt;</span></pre>
And then call that function from our C# using our WebBrowser control.
<pre class="code"><span style="background: white; color: black;">Browser.InvokeScript(</span><span style="background: white; color: #a31515;">"changeTitle"</span><span style="background: white; color: black;">);</span></pre>
If our function has parameters, we can add those parameters using InvokeScript
<pre class="code"><span style="background: white; color: black;">Browser.InvokeScript(</span><span style="background: white; color: #a31515;">"changeTitle"</span><span style="background: white; color: black;">, </span><span style="background: white; color: blue;">new string</span><span style="background: white; color: black;">[]{</span><span style="background: white; color: #a31515;">"change using parameter"</span><span style="background: white; color: black;">});</span></pre>
<h3>Add Javascript Using C#</h3>
The last way to run Javascript is to just inject it into the page. In this case, we could just update our app using:
<pre class="code"><span style="background: white; color: black;">Browser.InvokeScript(</span><span style="background: white; color: #a31515;">"eval"</span><span style="background: white; color: black;">, 
</span><span style="background: white; color: blue;"> new string</span><span style="background: white; color: black;">[] { </span><span style="background: white; color: #a31515;">"document.getElementById('dynamicTitle').innerHTML = 'injected javascript';" </span><span style="background: white; color: black;">});</span></pre>
When the question is “which method do I use to run my Javascript” the only real answer is “whichever one fits your scenario”. If you’re writing an app using mostly HTML/JS and just relying on the WebBrowser to act as a container, I’d lean as much as possible on running Javascript in my HTML/JS files.

However if you’re using the WebBrowser in a mixed-code application using C# to do some things and HTML/JS to do others, it might make sense to add some functions as entry-points so we can launch Javascript functions based off of events in the C#.
<h3>Talk To the App (C#) From the Browser</h3>
Of course, if we’re communicating to the browser from C#, we might want to talk to C# from the browser as well. If you want to send information to C# from the browser, just run the following Javascript code:
<pre class="code"><span style="background: white; color: black;">window.external.notify(</span><span style="background: white; color: #a31515;">"This is a notification from HTML"</span><span style="background: white; color: black;">);</span></pre>
and the browser will launch an event called ScriptNotify. We can tell our app to handle that script launch either in the XAML of our WebBrowser:
<pre class="code"><span style="background: white; color: blue;">&lt;</span><span style="background: white; color: #a31515;">phone</span><span style="background: white; color: blue;">:</span><span style="background: white; color: #a31515;">WebBrowser </span><span style="background: white; color: red;">x</span><span style="background: white; color: blue;">:</span><span style="background: white; color: red;">Name</span><span style="background: white; color: blue;">="Browser" 
</span><span style="background: white; color: red;"> ScriptNotify</span><span style="background: white; color: blue;">="HTML_Script_Launched" /&gt;</span></pre>
Or by assigning it in the xaml.cs file
<pre class="code"><span style="background: white; color: black;">Browser.ScriptNotify += HTML_Script_Launched;</span></pre>
then we can read out the notification in our event handler. The example below just takes whatever notification we sent and puts it into a MessageBox.
<pre class="code"><span style="background: white; color: blue;">private void </span><span style="background: white; color: black;">HTML_Script_Launched(</span><span style="background: white; color: blue;">object </span><span style="background: white; color: black;">sender, </span><span style="background: white; color: #2b91af;">NotifyEventArgs </span><span style="background: white; color: black;">e) 
{ 
</span><span style="background: white; color: #2b91af;"> MessageBox</span><span style="background: white; color: black;">.Show(e.Value); 
}</span></pre>
We can use this to interact with app-specific functionality like launchers and choosers or launching a MessageBox or perhaps communicating with the app bar.]]></content:encoded>
    </item>
    <item>
      <title>Weekly Links – 2-11-2012</title>
      <link>https://docs.microsoft.com/archive/blogs/matthiasshapiro/weekly-links-2-11-2012</link>
      <pubDate>Mon, 11 Feb 2013 08:47:40 GMT</pubDate>
      <dc:creator><![CDATA[MatthiasShapiroExt]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/matthiasshapiro/2013/02/11/weekly-links-2-11-2012/</guid>
      <description><![CDATA[Due to travel and other engagements, I’ve missed a couple of weekly links, so this one will be...]]></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>    <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>    <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>    <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>    <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>    <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>    <li><a href="https://nuget.org/packages/Coding4Fun.Toolkit.Complete/">Coding4Fun Toolkit</a>&#160; (Clint Rutkas) – An incredibly valuable toolkit for Windows Phone / Windows 8 development. Includes GzipWebclient, Audio Recorder, storage wrappers, additional controls. Really cool.</li>    <li><a href="http://proximitytapper.codeplex.com/">Proximity Tapper</a> – NFC emulation for the Windows Phone emulator.</li>    <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>    <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>    <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>    <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>    <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>    <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>    <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>    <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>    <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>    <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>    <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>    <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>    <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>    <li><a href="https://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>    <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>    <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>    <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>    <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>    <li><a href="http://www.placecage.com/">PlaceCage</a> – a set of flexible image placeholders featuring Nic Cage</li>    <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="https://channel9.msdn.com/Events/Build/2012/3-055">Kinect for Windows Programming Deep Drive Build talk</a>)</li>    <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="https://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>    <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.&quot; </li>    <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>    <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>    <li><a href="http://www.phdcomics.com/comics.php?f=1553">Your Conference Presentation</a> (from PhD Comics)</li>    <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>
    </item>
    <item>
      <title>Using an AdControl in a Trial App (Windows Phone)</title>
      <link>https://docs.microsoft.com/archive/blogs/matthiasshapiro/using-an-adcontrol-in-a-trial-app-windows-phone</link>
      <pubDate>Sun, 27 Jan 2013 02:38:43 GMT</pubDate>
      <dc:creator><![CDATA[MatthiasShapiroExt]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/matthiasshapiro/2013/01/27/using-an-adcontrol-in-a-trial-app-windows-phone/</guid>
      <description><![CDATA[I had to search around for this information so I thought it would be nice to have it somewhere...]]></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 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"><span style="background: white; color: blue;">&lt;</span><span style="background: white; color: rgb(163, 21, 21);">Grid </span><span style="background: white; color: red;">x</span><span style="background: white; color: blue;">:</span><span style="background: white; color: red;">Name</span><span style="background: white; color: blue;">=&quot;LayoutRoot&quot; &gt;
    &lt;</span><span style="background: white; color: rgb(163, 21, 21);">Grid.RowDefinitions</span><span style="background: white; color: blue;">&gt;
        &lt;</span><span style="background: white; color: rgb(163, 21, 21);">RowDefinition </span><span style="background: white; color: red;">Height</span><span style="background: white; color: blue;">=&quot;*&quot;/&gt;
        &lt;</span><span style="background: white; color: rgb(163, 21, 21);">RowDefinition </span><span style="background: white; color: red;">Height</span><span style="background: white; color: blue;">=&quot;Auto&quot;/&gt;
    &lt;/</span><span style="background: white; color: rgb(163, 21, 21);">Grid.RowDefinitions</span><span style="background: white; color: blue;">&gt;
    &lt;</span><span style="background: white; color: rgb(163, 21, 21);">Grid </span><span style="background: white; color: red;">x</span><span style="background: white; color: blue;">:</span><span style="background: white; color: red;">Name</span><span style="background: white; color: blue;">=&quot;MyContent&quot;&gt;
        </span><span style="background: white; color: green;">&lt;!-- all my UI goes here --&gt;
    </span><span style="background: white; color: blue;">&lt;/</span><span style="background: white; color: rgb(163, 21, 21);">Grid</span><span style="background: white; color: blue;">&gt;
    &lt;</span><span style="background: white; color: rgb(163, 21, 21);">Border </span><span style="background: white; color: red;">x</span><span style="background: white; color: blue;">:</span><span style="background: white; color: red;">Name</span><span style="background: white; color: blue;">=&quot;AdControlHolder&quot; </span><span style="background: white; color: red;">Grid.Row</span><span style="background: white; color: blue;">=&quot;1&quot;&gt;
    &lt;/</span><span style="background: white; color: rgb(163, 21, 21);">Border</span><span style="background: white; color: blue;">&gt;
&lt;/</span><span style="background: white; color: rgb(163, 21, 21);">Grid</span><span style="background: white; color: blue;">&gt;</span></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"><span style="background: white; color: rgb(43, 145, 175);">LicenseInformation </span><span style="background: white; color: black;">info = </span><span style="background: white; color: blue;">new </span><span style="background: white; color: rgb(43, 145, 175);">LicenseInformation</span><span style="background: white; color: black;">();
</span><span style="background: white; color: blue;">#if </span><span style="background: white; color: black;">DEBUG
</span><span style="background: white; color: blue;">if </span><span style="background: white; color: black;">(</span><span style="background: white; color: blue;">true</span><span style="background: white; color: black;">) 
</span><span style="background: white; color: blue;">#else
</span><span style="background: white; color: gray;">if ( info.IsTrial() ) 
</span><span style="background: white; color: blue;">#endif                
</span><span style="background: white; color: black;">{    
    </span><span style="background: white; color: green;">// running in trial mode
    </span><span style="background: white; color: rgb(43, 145, 175);">AdControl </span><span style="background: white; color: black;">ac = </span><span style="background: white; color: blue;">new </span><span style="background: white; color: rgb(43, 145, 175);">AdControl</span><span style="background: white; color: black;">();
</span><span style="background: white; color: blue;">#if </span><span style="background: white; color: black;">DEBUG
    ac.AdUnitId = </span><span style="background: white; color: rgb(163, 21, 21);">&quot;Image480_80&quot;</span><span style="background: white; color: black;">;
    </span><span style="background: white; color: green;">// or for text ads
    //ac.AdUnitId = &quot;TextAd&quot;;
    // or for smaller ads
    //ac.AdUnitId = &quot;Image300_50&quot;;
    </span><span style="background: white; color: black;">ac.ApplicationId = </span><span style="background: white; color: rgb(163, 21, 21);">&quot;test_client&quot;</span><span style="background: white; color: black;">;
</span><span style="background: white; color: blue;">#else<br /></span><span style="background: white; color: blue;">    </span><span style="background: white; color: gray;">ac.AdUnitId = &quot;000000&quot;; // insert your AdUnitId from the pubCenter site
    <br />    <br />    // add your ApplicationId from the pubCenter<br />    ac.ApplicationId = &quot;12345678-1234-1234-1234-123456789012&quot;;
 </span><span style="background: white; color: blue;">#endif
    </span><span style="background: white; color: black;">ac.Width = 480;
    ac.Height = 80;
    AdControlHolder.Child = ac;
}</span></pre>


<p>And that should be good to get started!</p>]]></content:encoded>
    </item>
    <item>
      <title>Weekly Links, January 15 2013</title>
      <link>https://docs.microsoft.com/archive/blogs/matthiasshapiro/weekly-links-january-15-2013</link>
      <pubDate>Tue, 15 Jan 2013 11:04:36 GMT</pubDate>
      <dc:creator><![CDATA[MatthiasShapiroExt]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/matthiasshapiro/2013/01/15/weekly-links-january-15-2013/</guid>
      <description><![CDATA[Windows Phone     Limiting TextBox Input To Integers in Windows Phone – Simple enough, but I use it...]]></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&#160; looking at auditory responses characteristic in psychotic diagnoses (could lead to identifying genetic markers for these conditions). </li> </ul>]]></content:encoded>
    </item>
  </channel>
</rss>