<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/atom.xsl" media="screen"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-US"><title type="html">Appsmash</title><subtitle type="html">Windows Phone Apps from Concept To Reality</subtitle><id>http://blogs.msdn.com/b/matthiasshapiro/atom.aspx</id><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/matthiasshapiro/" /><link rel="self" type="application/atom+xml" href="http://blogs.msdn.com/b/matthiasshapiro/atom.aspx" /><generator uri="http://telligent.com" version="5.6.50428.7875">Telligent Evolution Platform Developer Build (Build: 5.6.50428.7875)</generator><updated>2013-01-02T09:45:17Z</updated><entry><title>10 Great Windows Phone 8 Code Samples (No, Wait… 30)</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/matthiasshapiro/archive/2013/03/21/10-great-windows-phone-8-code-samples-no-wait-30.aspx" /><id>http://blogs.msdn.com/b/matthiasshapiro/archive/2013/03/21/10-great-windows-phone-8-code-samples-no-wait-30.aspx</id><published>2013-03-21T20:18:00Z</published><updated>2013-03-21T20:18:00Z</updated><content type="html">&lt;p&gt;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 &lt;a href="http://code.msdn.microsoft.com/site/search?f%5B1%5D.Value=Windows%20Phone%208"&gt;wealth of samples available for Windows Phone on MSDN&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;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. &lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-55-32-metablogapi/1602.image_5F00_50E38B4B.png"&gt;&lt;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/1602.image_5F00_50E38B4B.png" width="488" height="282" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;(click to enlarge)&lt;/p&gt;  &lt;p&gt;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. &lt;/p&gt;  &lt;p&gt;For an interactive version of this visual, I built a little Silverlight app&lt;/p&gt;  &lt;p&gt;&lt;a href="http://wp8samples.azurewebsites.net/WP8_Samples.html"&gt;Interactive Windows Phone 8 Samples Browser&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;I also wanted to highlight 10 of my favorite samples from that chart.&lt;/p&gt;  &lt;h2&gt;10) &lt;a href="http://code.msdn.microsoft.com/URI-Association-Sample-7915a233"&gt;URI Association and NFC&lt;/a&gt;&amp;#160;&lt;/h2&gt;  &lt;p&gt;&lt;a href="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"&gt;&lt;img title="wp_ss_20130320_0007" style="display: inline; background-image: none;" border="0" alt="wp_ss_20130320_0007" src="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" /&gt;&lt;/a&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;a href="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"&gt;&lt;img title="wp_ss_20130320_0005" style="display: inline; background-image: none;" border="0" alt="wp_ss_20130320_0005" src="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" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;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. &lt;/p&gt;  &lt;p&gt;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.&lt;/p&gt;  &lt;h2&gt;9) &lt;a href="http://code.msdn.microsoft.com/PhotoHub-Windows-Phone-8-fd7a1093"&gt;LongListSelector PhotoHub&lt;/a&gt;&lt;/h2&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-55-32-metablogapi/5811.image_5F00_221DD2A9.png"&gt;&lt;img title="image" style="margin: 0px; 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/8547.image_5F00_thumb_5F00_61E7B92E.png" width="149" height="244" /&gt;&lt;/a&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-55-32-metablogapi/0118.image_5F00_08B5CF6F.png"&gt;&lt;img title="image" style="margin: 0px; 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/7065.image_5F00_thumb_5F00_53A9403E.png" width="148" height="244" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;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 &lt;a href="http://code.msdn.microsoft.com/PeopleHub-Windows-Phone-80-88abe94d"&gt;LongListSelector PeopleHub&lt;/a&gt;.&lt;/p&gt;  &lt;h2&gt;8) &lt;a href="http://code.msdn.microsoft.com/TwitterSearch-Windows-b7fc4e5e"&gt;LongListSelector Infininte Scrolling (With Twitter)&lt;/a&gt;&amp;#160;&lt;/h2&gt;  &lt;p&gt;&lt;a href="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"&gt;&lt;img title="wp_ss_20130320_0004" style="display: inline; background-image: none;" border="0" alt="wp_ss_20130320_0004" src="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" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;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.&lt;/p&gt;  &lt;h2&gt;7) &lt;a href="http://code.msdn.microsoft.com/wpapps/Visual-Studio-3D-Starter-455a15f1"&gt;Visual Studio 3D Starter Kit&lt;/a&gt;&lt;/h2&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-55-32-metablogapi/6153.image_5F00_4F32BF77.png"&gt;&lt;img title="image" style="margin: 0px; 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/4010.image_5F00_thumb_5F00_1A263047.png" width="149" height="244" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;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.&lt;/p&gt;  &lt;h2&gt;6) &lt;a href="http://code.msdn.microsoft.com/Speech-for-Windows-Phone-3771fc6d"&gt;Speech Recognition Using a Custom Grammar&lt;/a&gt;&lt;/h2&gt;  &lt;p&gt;&lt;a href="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"&gt;&lt;img title="wp_ss_20130321_00021" style="display: inline; background-image: none;" border="0" alt="wp_ss_20130321_00021" src="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" /&gt;&lt;/a&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;a href="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"&gt;&lt;img title="wp_ss_20130321_00031" style="display: inline; background-image: none;" border="0" alt="wp_ss_20130321_00031" src="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" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;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.&amp;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. &lt;/p&gt;  &lt;p&gt;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.&lt;/p&gt;  &lt;h2&gt;5) &lt;a href="http://code.msdn.microsoft.com/Wallet-membership-and-f5ffee3a"&gt;Wallet membership and deals&lt;/a&gt;&amp;#160;&lt;/h2&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-55-32-metablogapi/1682.image_5F00_278C434D.png"&gt;&lt;img title="image" style="margin: 0px; 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/1106.image_5F00_thumb_5F00_727FB41C.png" width="148" height="244" /&gt;&lt;/a&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-55-32-metablogapi/7043.image_5F00_3968D71A.png"&gt;&lt;img title="image" style="margin: 0px; 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/5808.image_5F00_thumb_5F00_473B1D15.png" width="149" height="244" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;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.&lt;/p&gt;  &lt;h2&gt;4) &lt;a href="http://code.msdn.microsoft.com/wpapps/Windows-Phone-8-Networking-835239c1"&gt;Windows Phone 8 Networking Samples&lt;/a&gt;&lt;/h2&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-55-32-metablogapi/3755.image_5F00_7932BD9F.png"&gt;&lt;img title="image" style="margin: 0px; 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/2350.image_5F00_thumb_5F00_0705039B.png" width="148" height="244" /&gt;&lt;/a&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-55-32-metablogapi/0216.image_5F00_4DEE2698.png"&gt;&lt;img title="image" style="margin: 0px; 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/6153.image_5F00_thumb_5F00_2DD319DB.png" width="150" height="244" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;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. &lt;/p&gt;  &lt;h2&gt;3) &lt;a href="http://code.msdn.microsoft.com/ChatterBox-VoIP-sample-app-b1e63b8b"&gt;Chatterbox VoIP Sample App&lt;/a&gt;&lt;/h2&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-55-32-metablogapi/1205.image_5F00_0DB80D1E.png"&gt;&lt;img title="image" style="margin: 0px; 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/5305.image_5F00_thumb_5F00_3FAFADA8.png" width="148" height="244" /&gt;&lt;/a&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;a href="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"&gt;&lt;img title="wp_ss_20130321_0002" style="display: inline; background-image: none;" border="0" alt="wp_ss_20130321_0002" src="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" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;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 &lt;/p&gt;  &lt;h2&gt;2) &lt;a href="http://code.msdn.microsoft.com/Basic-Lens-sample-359fda1b"&gt;Basic Lens App&lt;/a&gt;&lt;/h2&gt;  &lt;p&gt;&lt;a href="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"&gt;&lt;img title="wp_ss_20130321_0005" style="display: inline; background-image: none;" border="0" alt="wp_ss_20130321_0005" src="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" /&gt;&lt;/a&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;a href="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"&gt;&lt;img title="wp_ss_20130321_0004" style="display: inline; background-image: none;" border="0" alt="wp_ss_20130321_0004" src="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" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;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.&lt;/p&gt;  &lt;h2&gt;1) &lt;a href="http://code.msdn.microsoft.com/Photo-Extensibility-Sample-db289044"&gt;Photo Extensibility&lt;/a&gt;&lt;/h2&gt;  &lt;p&gt;&lt;a href="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"&gt;&lt;img title="wp_ss_20130321_0008" style="margin: 0px; display: inline; background-image: none;" border="0" alt="wp_ss_20130321_0008" src="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" /&gt;&lt;/a&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;a href="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"&gt;&lt;img title="wp_ss_20130321_0009" style="display: inline; background-image: none;" border="0" alt="wp_ss_20130321_0009" src="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" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;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.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10404330" width="1" height="1"&gt;</content><author><name>MatthiasShapiro</name><uri>http://blogs.msdn.com/matthias.shapiro_4000_gmail.com/ProfileUrlRedirect.ashx</uri></author><category term="C#" scheme="http://blogs.msdn.com/b/matthiasshapiro/archive/tags/C_2300_/" /><category term="Windows Phone 8" scheme="http://blogs.msdn.com/b/matthiasshapiro/archive/tags/Windows+Phone+8/" /><category term="Lego" scheme="http://blogs.msdn.com/b/matthiasshapiro/archive/tags/Lego/" /><category term="Mindstorms" scheme="http://blogs.msdn.com/b/matthiasshapiro/archive/tags/Mindstorms/" /><category term="Wallet" scheme="http://blogs.msdn.com/b/matthiasshapiro/archive/tags/Wallet/" /><category term="Speech" scheme="http://blogs.msdn.com/b/matthiasshapiro/archive/tags/Speech/" /></entry><entry><title>Missing OpenStreamForWriteAsync on my StorageFile</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/matthiasshapiro/archive/2013/03/12/missing_2D00_openstreamforwriteasync_2D00_on_2D00_my_2D00_storagefile.aspx" /><id>http://blogs.msdn.com/b/matthiasshapiro/archive/2013/03/12/missing_2D00_openstreamforwriteasync_2D00_on_2D00_my_2D00_storagefile.aspx</id><published>2013-03-12T22:09:33Z</published><updated>2013-03-12T22:09:33Z</updated><content type="html">&lt;p&gt;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:&lt;/p&gt;  &lt;pre class="code"&gt;&lt;span style="background: white; color: rgb(43, 145, 175);"&gt;StorageFile &lt;/span&gt;&lt;span style="background: white; color: black;"&gt;kittenFile = &lt;/span&gt;&lt;span style="background: white; color: blue;"&gt;await &lt;/span&gt;&lt;span style="background: white; color: rgb(43, 145, 175);"&gt;ApplicationData&lt;/span&gt;&lt;span style="background: white; color: black;"&gt;.Current.LocalFolder.CreateFileAsync(&lt;/span&gt;&lt;span style="background: white; color: rgb(163, 21, 21);"&gt;&amp;quot;Kittens4Ever.kittens&amp;quot;&lt;/span&gt;&lt;span style="background: white; color: black;"&gt;, &lt;/span&gt;&lt;span style="background: white; color: rgb(43, 145, 175);"&gt;CreationCollisionOption&lt;/span&gt;&lt;span style="background: white; color: black;"&gt;.ReplaceExisting);

&lt;/span&gt;&lt;span style="background: white; color: blue;"&gt;var &lt;/span&gt;&lt;span style="background: white; color: black;"&gt;writeStream = &lt;/span&gt;&lt;span style="background: white; color: blue;"&gt;await &lt;/span&gt;&lt;span style="background: white; color: black;"&gt;kittenFile.OpenStreamForWriteAsync();
&lt;/span&gt;&lt;span style="background: white; color: rgb(43, 145, 175);"&gt;DataContractSerializer &lt;/span&gt;&lt;span style="background: white; color: black;"&gt;kittenSerial = &lt;/span&gt;&lt;span style="background: white; color: blue;"&gt;new &lt;/span&gt;&lt;span style="background: white; color: rgb(43, 145, 175);"&gt;DataContractSerializer&lt;/span&gt;&lt;span style="background: white; color: black;"&gt;(&lt;/span&gt;&lt;span style="background: white; color: blue;"&gt;typeof&lt;/span&gt;&lt;span style="background: white; color: black;"&gt;(&lt;/span&gt;&lt;span style="background: white; color: rgb(43, 145, 175);"&gt;ObservableCollection&lt;/span&gt;&lt;span style="background: white; color: black;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="background: white; color: rgb(43, 145, 175);"&gt;Kitten&lt;/span&gt;&lt;span style="background: white; color: black;"&gt;&amp;gt;));
kittenSerial.WriteObject(writeStream, listOfKittens);
                        
&lt;/span&gt;&lt;span style="background: white; color: blue;"&gt;await &lt;/span&gt;&lt;span style="background: white; color: black;"&gt;writeStream.FlushAsync();
writeStream.Close();&lt;/span&gt;&lt;/pre&gt;

&lt;p&gt;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: &lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;OpenStreamForWriterAsync (and OpenStreaForReadAsync) are extension methods that require System.IO to be added as a reference. So I just add it&lt;/p&gt;

&lt;pre class="code"&gt;&lt;span style="background: white; color: blue;"&gt;using &lt;/span&gt;&lt;span style="background: white; color: black;"&gt;System.IO;&lt;/span&gt;&lt;/pre&gt;

&lt;p&gt;and everything works fine.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10401769" width="1" height="1"&gt;</content><author><name>MatthiasShapiro</name><uri>http://blogs.msdn.com/matthias.shapiro_4000_gmail.com/ProfileUrlRedirect.ashx</uri></author><category term="Windows 8" scheme="http://blogs.msdn.com/b/matthiasshapiro/archive/tags/Windows+8/" /><category term="Windows Phone 8" scheme="http://blogs.msdn.com/b/matthiasshapiro/archive/tags/Windows+Phone+8/" /><category term="OpenStreamForWriteAsync" scheme="http://blogs.msdn.com/b/matthiasshapiro/archive/tags/OpenStreamForWriteAsync/" /><category term="OpenStreamForReadAsync" scheme="http://blogs.msdn.com/b/matthiasshapiro/archive/tags/OpenStreamForReadAsync/" /><category term="DataContractSerializer" scheme="http://blogs.msdn.com/b/matthiasshapiro/archive/tags/DataContractSerializer/" /><category term="StorageFile" scheme="http://blogs.msdn.com/b/matthiasshapiro/archive/tags/StorageFile/" /></entry><entry><title>Getting Started With Windows Phone 8 HTML5 Apps</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/matthiasshapiro/archive/2013/02/15/getting-started-with-windows-phone-8-html5-apps.aspx" /><id>http://blogs.msdn.com/b/matthiasshapiro/archive/2013/02/15/getting-started-with-windows-phone-8-html5-apps.aspx</id><published>2013-02-15T19:35:56Z</published><updated>2013-02-15T19:35:56Z</updated><content type="html">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 &lt;a href="http://dev.windowsphone.com/en-us/downloadsdk"&gt;Windows Phone 8 SDK.&lt;/a&gt;

You can also &lt;a href="http://matthiasshapiro.com/wp-content/uploads/2012/11/Tutorial_HTML_Project.zip"&gt;download the project with all these examples imeplemented&lt;/a&gt;.

First of all, one thing I found was that I need to turn on IsScriptEnabled in the WebBrowser control in our MainPage.xaml.
&lt;pre class="code"&gt;&lt;span style="background: white; color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="background: white; color: #a31515;"&gt;phone&lt;/span&gt;&lt;span style="background: white; color: blue;"&gt;:&lt;/span&gt;&lt;span style="background: white; color: #a31515;"&gt;WebBrowser &lt;/span&gt;&lt;span style="background: white; color: red;"&gt;x&lt;/span&gt;&lt;span style="background: white; color: blue;"&gt;:&lt;/span&gt;&lt;span style="background: white; color: red;"&gt;Name&lt;/span&gt;&lt;span style="background: white; color: blue;"&gt;="Browser" &lt;/span&gt;&lt;span style="background: white; color: red;"&gt;IsScriptEnabled&lt;/span&gt;&lt;span style="background: white; color: blue;"&gt;="True" /&amp;gt;&lt;/span&gt;&lt;/pre&gt;
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.
&lt;h3&gt;Turn Scrolling On or Off&lt;/h3&gt;
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 &lt;a href="http://www.scottlogic.co.uk/blog/colin/2011/11/suppressing-zoom-and-scroll-interactions-in-the-windows-phone-7-browser-control/"&gt;turn off scrolling the hard way (also known as the Windows Phone 7 compatible way)&lt;/a&gt; or the easy way, which is to go into your phone.css and add:
&lt;pre class="code"&gt;&lt;span style="background: white; color: maroon;"&gt;body &lt;/span&gt;&lt;span style="background: white; color: black;"&gt;{ &lt;/span&gt;&lt;span style="background: white; color: red;"&gt;-ms-touch-action&lt;/span&gt;&lt;span style="background: white; color: black;"&gt;:&lt;/span&gt;&lt;span style="background: white; color: blue;"&gt;none&lt;/span&gt;&lt;span style="background: white; color: black;"&gt;; }&lt;/span&gt;&lt;/pre&gt;
That takes care of some of our initial setup. Now let’s run some Javascript. We can run Javascript a couple ways.
&lt;h3&gt;Javascript: TheTraditional Way&lt;/h3&gt;
This way we focus entirely on HTML/JS. So if we give our page title an id:
&lt;pre class="code"&gt;&lt;span style="background: white; color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="background: white; color: maroon;"&gt;p &lt;/span&gt;&lt;span style="background: white; color: red;"&gt;id&lt;/span&gt;&lt;span style="background: white; color: blue;"&gt;="dynamicTitle"&amp;gt;&lt;/span&gt;&lt;span style="background: white; color: black;"&gt;page title&lt;/span&gt;&lt;span style="background: white; color: blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="background: white; color: maroon;"&gt;p&lt;/span&gt;&lt;span style="background: white; color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
and then we add a script to change that title
&lt;pre class="code"&gt;&lt;span style="background: white; color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="background: white; color: maroon;"&gt;script &lt;/span&gt;&lt;span style="background: white; color: red;"&gt;type&lt;/span&gt;&lt;span style="background: white; color: blue;"&gt;="text/javascript"&amp;gt; 
&lt;/span&gt;&lt;span style="background: white; color: black;"&gt; document.getElementById(&lt;/span&gt;&lt;span style="background: white; color: #a31515;"&gt;'dynamicTitle'&lt;/span&gt;&lt;span style="background: white; color: black;"&gt;).innerHTML = &lt;/span&gt;&lt;span style="background: white; color: #a31515;"&gt;"running javascript"; 
&lt;/span&gt;&lt;span style="background: white; color: blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="background: white; color: maroon;"&gt;script&lt;/span&gt;&lt;span style="background: white; color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
we’ll see that text updated at runtime. Super easy.
&lt;h3&gt;Run Javascript Function From C#&lt;/h3&gt;
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:
&lt;pre class="code"&gt;&lt;span style="background: white; color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="background: white; color: maroon;"&gt;script &lt;/span&gt;&lt;span style="background: white; color: red;"&gt;type&lt;/span&gt;&lt;span style="background: white; color: blue;"&gt;="text/javascript"&amp;gt;
 function &lt;/span&gt;&lt;span style="background: white; color: black;"&gt;changeTitle() { 
 document.getElementById(&lt;/span&gt;&lt;span style="background: white; color: #a31515;"&gt;'dynamicTitle'&lt;/span&gt;&lt;span style="background: white; color: black;"&gt;).innerHTML = &lt;/span&gt;&lt;span style="background: white; color: #a31515;"&gt;"function initiated in C#"&lt;/span&gt;&lt;span style="background: white; color: black;"&gt;; 
 }

 &lt;/span&gt;&lt;span style="background: white; color: blue;"&gt;function &lt;/span&gt;&lt;span style="background: white; color: black;"&gt;changeTitle(someNewText) { 
 document.getElementById(&lt;/span&gt;&lt;span style="background: white; color: #a31515;"&gt;'dynamicTitle'&lt;/span&gt;&lt;span style="background: white; color: black;"&gt;).innerHTML = someNewText; 
 } 
&lt;/span&gt;&lt;span style="background: white; color: blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="background: white; color: maroon;"&gt;script&lt;/span&gt;&lt;span style="background: white; color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
And then call that function from our C# using our WebBrowser control.
&lt;pre class="code"&gt;&lt;span style="background: white; color: black;"&gt;Browser.InvokeScript(&lt;/span&gt;&lt;span style="background: white; color: #a31515;"&gt;"changeTitle"&lt;/span&gt;&lt;span style="background: white; color: black;"&gt;);&lt;/span&gt;&lt;/pre&gt;
If our function has parameters, we can add those parameters using InvokeScript
&lt;pre class="code"&gt;&lt;span style="background: white; color: black;"&gt;Browser.InvokeScript(&lt;/span&gt;&lt;span style="background: white; color: #a31515;"&gt;"changeTitle"&lt;/span&gt;&lt;span style="background: white; color: black;"&gt;, &lt;/span&gt;&lt;span style="background: white; color: blue;"&gt;new string&lt;/span&gt;&lt;span style="background: white; color: black;"&gt;[]{&lt;/span&gt;&lt;span style="background: white; color: #a31515;"&gt;"change using parameter"&lt;/span&gt;&lt;span style="background: white; color: black;"&gt;});&lt;/span&gt;&lt;/pre&gt;
&lt;h3&gt;Add Javascript Using C#&lt;/h3&gt;
The last way to run Javascript is to just inject it into the page. In this case, we could just update our app using:
&lt;pre class="code"&gt;&lt;span style="background: white; color: black;"&gt;Browser.InvokeScript(&lt;/span&gt;&lt;span style="background: white; color: #a31515;"&gt;"eval"&lt;/span&gt;&lt;span style="background: white; color: black;"&gt;, 
&lt;/span&gt;&lt;span style="background: white; color: blue;"&gt; new string&lt;/span&gt;&lt;span style="background: white; color: black;"&gt;[] { &lt;/span&gt;&lt;span style="background: white; color: #a31515;"&gt;"document.getElementById('dynamicTitle').innerHTML = 'injected javascript';" &lt;/span&gt;&lt;span style="background: white; color: black;"&gt;});&lt;/span&gt;&lt;/pre&gt;
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#.
&lt;h3&gt;Talk To the App (C#) From the Browser&lt;/h3&gt;
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:
&lt;pre class="code"&gt;&lt;span style="background: white; color: black;"&gt;window.external.notify(&lt;/span&gt;&lt;span style="background: white; color: #a31515;"&gt;"This is a notification from HTML"&lt;/span&gt;&lt;span style="background: white; color: black;"&gt;);&lt;/span&gt;&lt;/pre&gt;
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:
&lt;pre class="code"&gt;&lt;span style="background: white; color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="background: white; color: #a31515;"&gt;phone&lt;/span&gt;&lt;span style="background: white; color: blue;"&gt;:&lt;/span&gt;&lt;span style="background: white; color: #a31515;"&gt;WebBrowser &lt;/span&gt;&lt;span style="background: white; color: red;"&gt;x&lt;/span&gt;&lt;span style="background: white; color: blue;"&gt;:&lt;/span&gt;&lt;span style="background: white; color: red;"&gt;Name&lt;/span&gt;&lt;span style="background: white; color: blue;"&gt;="Browser" 
&lt;/span&gt;&lt;span style="background: white; color: red;"&gt; ScriptNotify&lt;/span&gt;&lt;span style="background: white; color: blue;"&gt;="HTML_Script_Launched" /&amp;gt;&lt;/span&gt;&lt;/pre&gt;
Or by assigning it in the xaml.cs file
&lt;pre class="code"&gt;&lt;span style="background: white; color: black;"&gt;Browser.ScriptNotify += HTML_Script_Launched;&lt;/span&gt;&lt;/pre&gt;
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.
&lt;pre class="code"&gt;&lt;span style="background: white; color: blue;"&gt;private void &lt;/span&gt;&lt;span style="background: white; color: black;"&gt;HTML_Script_Launched(&lt;/span&gt;&lt;span style="background: white; color: blue;"&gt;object &lt;/span&gt;&lt;span style="background: white; color: black;"&gt;sender, &lt;/span&gt;&lt;span style="background: white; color: #2b91af;"&gt;NotifyEventArgs &lt;/span&gt;&lt;span style="background: white; color: black;"&gt;e) 
{ 
&lt;/span&gt;&lt;span style="background: white; color: #2b91af;"&gt; MessageBox&lt;/span&gt;&lt;span style="background: white; color: black;"&gt;.Show(e.Value); 
}&lt;/span&gt;&lt;/pre&gt;
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.&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10394103" width="1" height="1"&gt;</content><author><name>MatthiasShapiro</name><uri>http://blogs.msdn.com/matthias.shapiro_4000_gmail.com/ProfileUrlRedirect.ashx</uri></author><category term="Windows Phone 8" scheme="http://blogs.msdn.com/b/matthiasshapiro/archive/tags/Windows+Phone+8/" /><category term="Javascript" scheme="http://blogs.msdn.com/b/matthiasshapiro/archive/tags/Javascript/" /><category term="HTML5" scheme="http://blogs.msdn.com/b/matthiasshapiro/archive/tags/HTML5/" /></entry><entry><title>Weekly Links – 2-11-2012</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/matthiasshapiro/archive/2013/02/11/weekly-links-2-11-2012.aspx" /><id>http://blogs.msdn.com/b/matthiasshapiro/archive/2013/02/11/weekly-links-2-11-2012.aspx</id><published>2013-02-11T16:47:40Z</published><updated>2013-02-11T16:47:40Z</updated><content type="html">&lt;p&gt;Due to travel and other engagements, I’ve missed a couple of weekly links, so this one will be slightly larger.&lt;/p&gt;  &lt;p&gt;One thing I want to call out specifically is that Ben Riga and I have been working on a set of sessions on &lt;a href="http://msl-events.cloudapp.net/EventRegistration.aspx?eid=14dccc84-f07f-4acf-a3e4-9707efe693c7&amp;amp;mva=true"&gt;building for both Windows 8 and Windows Phone 8&lt;/a&gt;. 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.&lt;/p&gt;  &lt;h2&gt;Windows Phone 8&lt;/h2&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a href="http://blogs.windows.com/windows_phone/b/windowsphone/archive/2013/02/08/spotify-arrives-on-windows-phone-8.aspx"&gt;Spotify is available for Windows Phone 8&lt;/a&gt;!&lt;/li&gt;    &lt;li&gt;&lt;a href="http://blog.brightpointuk.co.uk/running-windows-phone-8-emulator-mac-os"&gt;Running the Windows Phone 8 emulator on a Mac OS&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.developer.nokia.com/Community/Wiki/Windows_Phone_8_SDK_on_a_Virtual_Machine_with_Working_Emulator"&gt;Windows Phone 8 SDK on a Virtual Machine with a Working Emulator&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/windowsphone/develop/hh394009(v=vs.105).aspx"&gt;Using the Share Link task for Windows Phone&lt;/a&gt; – takes in a link and shares it with any of the social networks already integrated into the device&lt;/li&gt;    &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/windowsphone/develop/jj684580(v=vs.105).aspx"&gt;How to connect to a local web services using with Windows Phone 8 emulator&lt;/a&gt; (hint: boundary machine)&lt;/li&gt;    &lt;li&gt;&lt;a href="http://cmsresources.windowsphone.com/devcenter/en-us/downloads/064028-microsoft-poster.pdf"&gt;Windows Phone API Quickstart&lt;/a&gt; – a nice big visual summary of the Windows Phone APIs&lt;/li&gt;    &lt;li&gt;&lt;a href="https://nuget.org/packages/Coding4Fun.Toolkit.Complete/"&gt;Coding4Fun Toolkit&lt;/a&gt;&amp;#160; (Clint Rutkas) – An incredibly valuable toolkit for Windows Phone / Windows 8 development. Includes GzipWebclient, Audio Recorder, storage wrappers, additional controls. Really cool.&lt;/li&gt;    &lt;li&gt;&lt;a href="http://proximitytapper.codeplex.com/"&gt;Proximity Tapper&lt;/a&gt; – NFC emulation for the Windows Phone emulator.&lt;/li&gt;    &lt;li&gt;&lt;a href="http://msicc.net/?p=3474"&gt;NFC Toolkit beta testing&lt;/a&gt; – from &lt;a href="https://twitter.com/#!/msicc"&gt;@MSicc&lt;/a&gt;, a beta app for NFC tag reading, writing and profiles&lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.windowsphone.com/en-us/how-to/wp8/windows-phone-app-for-desktop"&gt;Windows Phone app for desktop (Preview 3)&lt;/a&gt; – The missing link between your Windows Phone 8 phone and your media libraries&lt;/li&gt;    &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/windowsphone/develop/jj206987(v=vs.105).aspx"&gt;Auto-launching apps using file and URI associations for Windows Phone 8&lt;/a&gt; – an underappreciated feature, but one that I’ve implemented to great effect&lt;/li&gt;    &lt;li&gt;&lt;a href="http://blogs.msdn.com/b/mustafakasap/archive/2013/01/22/wallet-amp-in-app-purchase-for-windows-phone-8.aspx"&gt;Wallet and In-App Purchase for Windows Phone 8&lt;/a&gt; ( Mustafa Kasap) – HUGE post on integrating Wallet features and functionality and in-app purchases into your Windows Phone app&lt;/li&gt;    &lt;li&gt;&lt;a href="http://matthiasshapiro.com/2013/01/27/using-an-adcontrol-in-a-trial-app-windows-phone/"&gt;Using an Ad Control in a Trial App (With Debugging Support)&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="http://code.msdn.microsoft.com/site/search?f%5B0%5D.Type=Platform&amp;amp;f%5B0%5D.Value=Phone&amp;amp;f%5B0%5D.Text=Phone&amp;amp;f%5B1%5D.Type=VisualStudioVersion&amp;amp;f%5B1%5D.Value=11.0&amp;amp;f%5B1%5D.Text=Visual%20Studio%202012&amp;amp;f%5B2%5D.Type=Technology&amp;amp;f%5B2%5D.Value=Windows%20Phone%208"&gt;All the MSDN Code Gallery samples for Windows Phone 8&lt;/a&gt; (about 90 items)&lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.wpcentral.com/super-nintendo-emulator-windows-phone-8?utm_source=wpc&amp;amp;utm_medium=twitter"&gt;Super NES emulator app for Windows Phone 8&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.engadget.com/2013/01/18/lumia-820-3d-printed-back-covers/?a_dgi=aolshare_twitter"&gt;3D Print your own Lumia 820 cover using the official specs from Nokia&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.kunal-chowdhury.com/2011/11/how-can-you-add-network-connection.html"&gt;Adding Network Connection Settings to your Windows Phone app&lt;/a&gt; (Airplane Mode, Bluetooth, Cell, Wifi)&lt;/li&gt;    &lt;li&gt;&lt;a href="http://codeiuse.tumblr.com/post/40635877824/basic-speech-synthesis-in-windows-phone-8"&gt;Basic Speech Synthesis in Windows Phone 8&lt;/a&gt; (code)&lt;/li&gt;    &lt;li&gt;&lt;a href="http://codeiuse.tumblr.com/post/40635743354/basic-speech-recognition-in-windows-phone-8"&gt;Basic Speech Recognition in Windows Phone 8&lt;/a&gt; (code)&lt;/li&gt; &lt;/ul&gt;  &lt;h2&gt;Windows Phone 8 HTML/JS&lt;/h2&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a href="http://blogs.msdn.com/b/davedev/archive/2013/02/07/build-a-hybrid-app-for-windows-phone-8-using-appmobi.aspx"&gt;Build a Hybrid App for Windows Phone 8 using appMobi&lt;/a&gt; (Dave Isbitski &lt;a href="https://twitter.com/thedavedev"&gt;@thedavedev&lt;/a&gt;) – Starting to see Windows Phone 8 support in a lot of the HTML5-based cross-platform tools. &lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.yoyogames.com/gamemaker/studio/master"&gt;YoYo Games GameMaker Studio&lt;/a&gt; – 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?) &lt;/li&gt; &lt;/ul&gt;  &lt;h2&gt;Windows 8&lt;/h2&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/windows/apps/hh465496.aspx"&gt;Adding a ListView to Display a List of Items in Windows 8&lt;/a&gt; (HTML/JS) And then &lt;a href="http://msdn.microsoft.com/en-us/library/windows/apps/jj585523.aspx"&gt;adding a template and functionality to those listview items&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://kevinashley.com/making-30000-a-month-on-windows-8-apps/"&gt;Making $30K a month on Windows 8 apps&lt;/a&gt; – It can be done.&lt;/li&gt;    &lt;li&gt;&lt;a href="http://channel9.msdn.com/coding4fun/articles/Fall-Fury-Part-2-Shaders?utm_source=dlvr.it&amp;amp;utm_medium=twitter"&gt;Fall Fury: Part 2 – Shaders&lt;/a&gt; – Some of the geniuses at Channel 9 are outlining how they built the &lt;a href="http://apps.microsoft.com/windows/en-us/app/c4f-fallfury/e23c36da-1a5e-4389-bcfc-ea388afc4746"&gt;Fall Fury game&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.pocketgamer.biz/r/PG.Biz/Windows+8/news.asp?c=48217"&gt;HTML5 game Mudvark hitting hundreds of thousands of downloads on Windows 8&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.sharpgis.net/post/2012/01/12/Reading-and-Writing-text-files-in-Windows-8-Metro.aspx"&gt;Reading and Writing Text Files in Windows 8 Metro Store Apps&lt;/a&gt; (Morten Nielsen @dotMorten) – Same code also works in Windows Phone 8&lt;/li&gt;    &lt;li&gt;&lt;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"&gt;How do I port my iOS or Android app to Windows 8&lt;/a&gt; (Windows Store)? (videos)&lt;/li&gt;    &lt;li&gt;&lt;a href="http://winsupersite.com/windows-phone/windows-phone-8-tips-ultimate-compendium?utm_source=twitterfeed&amp;amp;utm_medium=twitter"&gt;A stupid huge list of tips for using/configuring Windows 8&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt;  &lt;h2&gt;Design and UX&lt;/h2&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a href="http://apps.microsoft.com/windows/en-us/app/colour-scheme-creator/b855adae-990f-47e1-8fd6-0af66c24d487"&gt;Color Scheme Creator&lt;/a&gt; – a simple Windows 8 app for constructing a color scheme based on a photograph&lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.placecage.com/"&gt;PlaceCage&lt;/a&gt; – a set of flexible image placeholders featuring Nic Cage&lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.fredriklundwall.com/Fredrik_Lundwall/366_logos.html"&gt;366 Logos&lt;/a&gt; – A logo a day every day of 2012. Each logo created in about an hour.&lt;/li&gt; &lt;/ul&gt;  &lt;h2&gt;Other Awesome Things&lt;/h2&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a href="http://robrelyea.com/demos/KinectMagicMirror/"&gt;Kinect Magic Mirror demo code&lt;/a&gt; (goes along with Rob Relyea’s &lt;a href="http://channel9.msdn.com/Events/Build/2012/3-055"&gt;Kinect for Windows Programming Deep Drive Build talk&lt;/a&gt;)&lt;/li&gt;    &lt;li&gt;&lt;a href="http://unicornfree.com/2013/why-we-shut-down-charm-on-the-eve-of-public-launch-at-48kyear-and-growing"&gt;Why We Shut Down Charm on the Even of Public Launch&lt;/a&gt; (Amy Hoy &lt;a href="http://twitter.com/amyhoy"&gt;@amyhoy&lt;/a&gt;) – balancing the success of a product against the scalability of that product and making the hard decisions that are right for the customers. Ouch.&lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.slideshare.net/twilio/building-a-great-web-api-evan-cooke-qcon-2011"&gt;Building a Great Web API&lt;/a&gt; (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.&amp;quot; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://runpee.com/"&gt;RunPee&lt;/a&gt; – 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.&lt;/li&gt;    &lt;li&gt;&lt;a href="http://stackoverflow.com/questions/11340673/why-does-parseint1-0-19-return-18"&gt;Why JavaScript kind of drives me crazy sometimes&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.phdcomics.com/comics.php?f=1553"&gt;Your Conference Presentation&lt;/a&gt; (from PhD Comics)&lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.coolmomtech.com/2013/01/talk_to_the_hand_bluetooth_gloves.php#more"&gt;Bluetooth gloves that work as a head-set for your phone&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10392680" width="1" height="1"&gt;</content><author><name>MatthiasShapiro</name><uri>http://blogs.msdn.com/matthias.shapiro_4000_gmail.com/ProfileUrlRedirect.ashx</uri></author><category term="Weekly Links" scheme="http://blogs.msdn.com/b/matthiasshapiro/archive/tags/Weekly+Links/" /></entry><entry><title>Using an AdControl in a Trial App (Windows Phone)</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/matthiasshapiro/archive/2013/01/27/using-an-adcontrol-in-a-trial-app-windows-phone.aspx" /><id>http://blogs.msdn.com/b/matthiasshapiro/archive/2013/01/27/using-an-adcontrol-in-a-trial-app-windows-phone.aspx</id><published>2013-01-27T10:38:43Z</published><updated>2013-01-27T10:38:43Z</updated><content type="html">&lt;p&gt;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.&lt;/p&gt;  &lt;p&gt;To start:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Download the &lt;a href="http://advertising.microsoft.com/mobile-apps"&gt;Microsoft Ads SDK&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;Sign into the &lt;a href="http://pubcenter.microsoft.com"&gt;Microsoft pubCenter&lt;/a&gt; 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.&lt;/li&gt; &lt;/ul&gt;  &lt;h2&gt;Add structure for your AdControl&lt;/h2&gt;  &lt;p&gt;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:&lt;/p&gt;  &lt;pre class="code"&gt;&lt;span style="background: white; color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="background: white; color: rgb(163, 21, 21);"&gt;Grid &lt;/span&gt;&lt;span style="background: white; color: red;"&gt;x&lt;/span&gt;&lt;span style="background: white; color: blue;"&gt;:&lt;/span&gt;&lt;span style="background: white; color: red;"&gt;Name&lt;/span&gt;&lt;span style="background: white; color: blue;"&gt;=&amp;quot;LayoutRoot&amp;quot; &amp;gt;
    &amp;lt;&lt;/span&gt;&lt;span style="background: white; color: rgb(163, 21, 21);"&gt;Grid.RowDefinitions&lt;/span&gt;&lt;span style="background: white; color: blue;"&gt;&amp;gt;
        &amp;lt;&lt;/span&gt;&lt;span style="background: white; color: rgb(163, 21, 21);"&gt;RowDefinition &lt;/span&gt;&lt;span style="background: white; color: red;"&gt;Height&lt;/span&gt;&lt;span style="background: white; color: blue;"&gt;=&amp;quot;*&amp;quot;/&amp;gt;
        &amp;lt;&lt;/span&gt;&lt;span style="background: white; color: rgb(163, 21, 21);"&gt;RowDefinition &lt;/span&gt;&lt;span style="background: white; color: red;"&gt;Height&lt;/span&gt;&lt;span style="background: white; color: blue;"&gt;=&amp;quot;Auto&amp;quot;/&amp;gt;
    &amp;lt;/&lt;/span&gt;&lt;span style="background: white; color: rgb(163, 21, 21);"&gt;Grid.RowDefinitions&lt;/span&gt;&lt;span style="background: white; color: blue;"&gt;&amp;gt;
    &amp;lt;&lt;/span&gt;&lt;span style="background: white; color: rgb(163, 21, 21);"&gt;Grid &lt;/span&gt;&lt;span style="background: white; color: red;"&gt;x&lt;/span&gt;&lt;span style="background: white; color: blue;"&gt;:&lt;/span&gt;&lt;span style="background: white; color: red;"&gt;Name&lt;/span&gt;&lt;span style="background: white; color: blue;"&gt;=&amp;quot;MyContent&amp;quot;&amp;gt;
        &lt;/span&gt;&lt;span style="background: white; color: green;"&gt;&amp;lt;!-- all my UI goes here --&amp;gt;
    &lt;/span&gt;&lt;span style="background: white; color: blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="background: white; color: rgb(163, 21, 21);"&gt;Grid&lt;/span&gt;&lt;span style="background: white; color: blue;"&gt;&amp;gt;
    &amp;lt;&lt;/span&gt;&lt;span style="background: white; color: rgb(163, 21, 21);"&gt;Border &lt;/span&gt;&lt;span style="background: white; color: red;"&gt;x&lt;/span&gt;&lt;span style="background: white; color: blue;"&gt;:&lt;/span&gt;&lt;span style="background: white; color: red;"&gt;Name&lt;/span&gt;&lt;span style="background: white; color: blue;"&gt;=&amp;quot;AdControlHolder&amp;quot; &lt;/span&gt;&lt;span style="background: white; color: red;"&gt;Grid.Row&lt;/span&gt;&lt;span style="background: white; color: blue;"&gt;=&amp;quot;1&amp;quot;&amp;gt;
    &amp;lt;/&lt;/span&gt;&lt;span style="background: white; color: rgb(163, 21, 21);"&gt;Border&lt;/span&gt;&lt;span style="background: white; color: blue;"&gt;&amp;gt;
&amp;lt;/&lt;/span&gt;&lt;span style="background: white; color: rgb(163, 21, 21);"&gt;Grid&lt;/span&gt;&lt;span style="background: white; color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;


&lt;h2&gt;Add logic to include the AdControl if we are in trial mode&lt;/h2&gt;

&lt;p&gt;If I don’t place anything in my Border control, it will be completely invisible. So what we’re going to do is:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Check to see if our app is in a trial mode&lt;/li&gt;

  &lt;li&gt;If it is, add the AdControl. Otherwise do nothing.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The only problem with this is that it can be difficult to test. For one thing, the &lt;a href="http://msdn.microsoft.com/en-us/library/advertising-mobile-windows-phone-test-mode-values%28v=msads.20%29.aspx"&gt;AdControl requires some custom parameters&lt;/a&gt; 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.&lt;/p&gt;

&lt;pre class="code"&gt;&lt;span style="background: white; color: rgb(43, 145, 175);"&gt;LicenseInformation &lt;/span&gt;&lt;span style="background: white; color: black;"&gt;info = &lt;/span&gt;&lt;span style="background: white; color: blue;"&gt;new &lt;/span&gt;&lt;span style="background: white; color: rgb(43, 145, 175);"&gt;LicenseInformation&lt;/span&gt;&lt;span style="background: white; color: black;"&gt;();
&lt;/span&gt;&lt;span style="background: white; color: blue;"&gt;#if &lt;/span&gt;&lt;span style="background: white; color: black;"&gt;DEBUG
&lt;/span&gt;&lt;span style="background: white; color: blue;"&gt;if &lt;/span&gt;&lt;span style="background: white; color: black;"&gt;(&lt;/span&gt;&lt;span style="background: white; color: blue;"&gt;true&lt;/span&gt;&lt;span style="background: white; color: black;"&gt;) 
&lt;/span&gt;&lt;span style="background: white; color: blue;"&gt;#else
&lt;/span&gt;&lt;span style="background: white; color: gray;"&gt;if ( info.IsTrial() ) 
&lt;/span&gt;&lt;span style="background: white; color: blue;"&gt;#endif                
&lt;/span&gt;&lt;span style="background: white; color: black;"&gt;{    
    &lt;/span&gt;&lt;span style="background: white; color: green;"&gt;// running in trial mode
    &lt;/span&gt;&lt;span style="background: white; color: rgb(43, 145, 175);"&gt;AdControl &lt;/span&gt;&lt;span style="background: white; color: black;"&gt;ac = &lt;/span&gt;&lt;span style="background: white; color: blue;"&gt;new &lt;/span&gt;&lt;span style="background: white; color: rgb(43, 145, 175);"&gt;AdControl&lt;/span&gt;&lt;span style="background: white; color: black;"&gt;();
&lt;/span&gt;&lt;span style="background: white; color: blue;"&gt;#if &lt;/span&gt;&lt;span style="background: white; color: black;"&gt;DEBUG
    ac.AdUnitId = &lt;/span&gt;&lt;span style="background: white; color: rgb(163, 21, 21);"&gt;&amp;quot;Image480_80&amp;quot;&lt;/span&gt;&lt;span style="background: white; color: black;"&gt;;
    &lt;/span&gt;&lt;span style="background: white; color: green;"&gt;// or for text ads
    //ac.AdUnitId = &amp;quot;TextAd&amp;quot;;
    // or for smaller ads
    //ac.AdUnitId = &amp;quot;Image300_50&amp;quot;;
    &lt;/span&gt;&lt;span style="background: white; color: black;"&gt;ac.ApplicationId = &lt;/span&gt;&lt;span style="background: white; color: rgb(163, 21, 21);"&gt;&amp;quot;test_client&amp;quot;&lt;/span&gt;&lt;span style="background: white; color: black;"&gt;;
&lt;/span&gt;&lt;span style="background: white; color: blue;"&gt;#else&lt;br /&gt;&lt;/span&gt;&lt;span style="background: white; color: blue;"&gt;    &lt;/span&gt;&lt;span style="background: white; color: gray;"&gt;ac.AdUnitId = &amp;quot;000000&amp;quot;; // insert your AdUnitId from the pubCenter site
    &lt;br /&gt;    &lt;br /&gt;    // add your ApplicationId from the pubCenter&lt;br /&gt;    ac.ApplicationId = &amp;quot;12345678-1234-1234-1234-123456789012&amp;quot;;
 &lt;/span&gt;&lt;span style="background: white; color: blue;"&gt;#endif
    &lt;/span&gt;&lt;span style="background: white; color: black;"&gt;ac.Width = 480;
    ac.Height = 80;
    AdControlHolder.Child = ac;
}&lt;/span&gt;&lt;/pre&gt;


&lt;p&gt;And that should be good to get started!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10388641" width="1" height="1"&gt;</content><author><name>MatthiasShapiro</name><uri>http://blogs.msdn.com/matthias.shapiro_4000_gmail.com/ProfileUrlRedirect.ashx</uri></author><category term="Windows Phone" scheme="http://blogs.msdn.com/b/matthiasshapiro/archive/tags/Windows+Phone/" /><category term="AdControl" scheme="http://blogs.msdn.com/b/matthiasshapiro/archive/tags/AdControl/" /><category term="Trial Mode" scheme="http://blogs.msdn.com/b/matthiasshapiro/archive/tags/Trial+Mode/" /></entry><entry><title>Weekly Links, January 15 2013</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/matthiasshapiro/archive/2013/01/15/weekly_2D00_links_2D00_january_2D00_15_2D00_2013.aspx" /><id>http://blogs.msdn.com/b/matthiasshapiro/archive/2013/01/15/weekly_2D00_links_2D00_january_2D00_15_2D00_2013.aspx</id><published>2013-01-15T19:04:36Z</published><updated>2013-01-15T19:04:36Z</updated><content type="html">&lt;h2&gt;Windows Phone&lt;/h2&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a href="http://codeiuse.tumblr.com/post/40553978496/limiting-textbox-input-to-integers-in-windows-phone"&gt;Limiting TextBox Input To Integers in Windows Phone&lt;/a&gt; – Simple enough, but I use it every couple of projects so I thought it should go somewhere I can find it.&lt;/li&gt;    &lt;li&gt;&lt;a href="http://blog.rajenki.com/2012/12/how-to-add-windows-phone-8-builds-to-your-existing-apps/"&gt;Add Windows Phone 8 Builds to your Existing Apps&lt;/a&gt; (Rajen Kishna &lt;a href="https://twitter.com/rajen_k"&gt;@rajen_k&lt;/a&gt;) – 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.&lt;/li&gt;    &lt;li&gt;&lt;a href="http://blogs.msdn.com/b/ptorr/archive/2011/07/11/background-agents-part-1-of-3.aspx"&gt;Background Agents for Windows Phone (Part 1 of 3)&lt;/a&gt; (Peter Torr) – I was working on some periodic task project this last week and Peter’s post was invaluable.&lt;/li&gt;    &lt;li&gt;&lt;a href="https://msevents.microsoft.com/cui/EventDetail.aspx?culture=nl-NL&amp;amp;EventID=1032541410&amp;amp;IO=31YlshLqrNo1LmwlW%2b8oAw%3d%3d"&gt;Windows Phone 8 Camp in Amsterdam&lt;/a&gt; – I’ll be speaking at the Windows Phone 8 Camp in the Netherlands this coming Wednesday (January 23). Hope to see you there!&lt;/li&gt;    &lt;li&gt;&lt;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"&gt;Windows Phone 8 skins for your emulator&lt;/a&gt; (Lee Stott &lt;a href="https://twitter.com/lee_stott"&gt;@lee_stott&lt;/a&gt;) – Will installing a custom skin on your Windows Phone 8 emulator make you a better Windows Phone developer? Yes. And I judge you accordingly. &lt;/li&gt;    &lt;li&gt;&lt;a href="http://phonegap.com/download/"&gt;PhoneGap 2.3.0 is out!&lt;/a&gt; – PhoneGap (now has support for Windows Phone 8)&lt;/li&gt; &lt;/ul&gt;  &lt;h2&gt;Windows 8&lt;/h2&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a href="http://msdn.microsoft.com/de-ch/aa570302.aspx?EventID=1032382762"&gt;MSDN TechTalk Event: Windows Store apps and games using HTML5, Javascript and CSS&lt;/a&gt; (starring Jeff Burtoft &lt;a href="https://twitter.com/boyofgreen"&gt;@boyofgreen&lt;/a&gt;) – 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.&lt;/li&gt; &lt;/ul&gt;  &lt;h2&gt;Design, HTML5, and Other&lt;/h2&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a href="http://www.scirra.com/construct2"&gt;Construct2&lt;/a&gt; – HTML5 game engine. I’m totally going to get into this… some day…&lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.blambot.com/font_perihelion.shtml"&gt;Perihelion font for $30&lt;/a&gt; – a pretty cool font&lt;/li&gt;    &lt;li&gt;&lt;a href="http://placekitten.com/"&gt;PlaceKitten.com&lt;/a&gt; – For when you need a kitten placeholder service for your designs&lt;/li&gt;    &lt;li&gt;&lt;a href="http://onlinelibrary.wiley.com/doi/10.1111/j.1469-8986.2011.01327.x/abstract;jsessionid=A965CBD7C0BDAABA2FECFA7D9350AA37.d02t03?deniedAccessCustomisedMessage=&amp;amp;userIsAuthenticated=false"&gt;EEG readings + data crunching = Phenotype patterns in psychotic diagnoses&lt;/a&gt; (John Robert Shapiro) – Yeah, I have weird leisure reading (inspired by my neuroscientist brother), but it’s actually some pretty cool EEG research&amp;#160; looking at auditory responses characteristic in psychotic diagnoses (could lead to identifying genetic markers for these conditions). &lt;/li&gt; &lt;/ul&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10385226" width="1" height="1"&gt;</content><author><name>MatthiasShapiro</name><uri>http://blogs.msdn.com/matthias.shapiro_4000_gmail.com/ProfileUrlRedirect.ashx</uri></author><category term="Windows Phone" scheme="http://blogs.msdn.com/b/matthiasshapiro/archive/tags/Windows+Phone/" /><category term="Windows 8" scheme="http://blogs.msdn.com/b/matthiasshapiro/archive/tags/Windows+8/" /><category term="Windows Store" scheme="http://blogs.msdn.com/b/matthiasshapiro/archive/tags/Windows+Store/" /></entry><entry><title>Windows Phone ScheduledTask Agents and FileNotFoundException</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/matthiasshapiro/archive/2013/01/11/windows-phone-scheduledtask-agents-and-filenotfoundexception.aspx" /><id>http://blogs.msdn.com/b/matthiasshapiro/archive/2013/01/11/windows-phone-scheduledtask-agents-and-filenotfoundexception.aspx</id><published>2013-01-11T22:29:05Z</published><updated>2013-01-11T22:29:05Z</updated><content type="html">&lt;p&gt;Maybe this is a problem that I’m all alone on, but it took me some time to figure out.&lt;/p&gt;  &lt;p&gt;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:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;FileNotFoundException was unhandled – An unhandled exception of type ‘System.UI.FileNotFoundException’ occurred in System.Windows.ni.dll&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Here’s what happened:&lt;/p&gt;  &lt;p&gt;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.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-55-32-metablogapi/2086.image_5F00_3D65EB42.png"&gt;&lt;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/7776.image_5F00_thumb_5F00_6F5D8BCC.png" width="192" height="79" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;If I had opened the properties section of the project&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-55-32-metablogapi/1018.image_5F00_3646AECA.png"&gt;&lt;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/2570.image_5F00_thumb_5F00_4418F4C5.png" width="344" height="136" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;I would have seen that my assembly name (which names the actual file we’re looking for) was still the old stupid name&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-55-32-metablogapi/0435.image_5F00_23FDE808.png"&gt;&lt;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/8030.image_5F00_thumb_5F00_55F58892.png" width="669" height="118" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;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.&lt;/p&gt;  &lt;pre class="code"&gt;&lt;span style="background: white; color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="background: white; color: rgb(163, 21, 21);"&gt;ExtendedTask &lt;/span&gt;&lt;span style="background: white; color: red;"&gt;Name&lt;/span&gt;&lt;span style="background: white; color: blue;"&gt;=&lt;/span&gt;&lt;span style="background: white; color: black;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="background: white; color: blue;"&gt;BackgroundTask&lt;/span&gt;&lt;span style="background: white; color: black;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="background: white; color: blue;"&gt;&amp;gt;
  &amp;lt;&lt;/span&gt;&lt;span style="background: white; color: rgb(163, 21, 21);"&gt;BackgroundServiceAgent
    &lt;/span&gt;&lt;span style="background: white; color: red;"&gt;Specifier&lt;/span&gt;&lt;span style="background: white; color: blue;"&gt;=&lt;/span&gt;&lt;span style="background: white; color: black;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="background: white; color: blue;"&gt;ScheduledTaskAgent&lt;/span&gt;&lt;span style="background: white; color: black;"&gt;&amp;quot;
    &lt;/span&gt;&lt;span style="background: white; color: red;"&gt;Name&lt;/span&gt;&lt;span style="background: white; color: blue;"&gt;=&lt;/span&gt;&lt;span style="background: white; color: black;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="background: white; color: blue;"&gt;MyAwesomeTask&lt;/span&gt;&lt;span style="background: white; color: black;"&gt;&amp;quot;
    &lt;/span&gt;&lt;span style="background: white; color: red;"&gt;Source&lt;/span&gt;&lt;span style="background: white; color: blue;"&gt;=&lt;/span&gt;&lt;span style="background: white; color: black;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="background: white; color: blue;"&gt;MyScheduledTask&lt;/span&gt;&lt;span style="background: white; color: black;"&gt;&amp;quot;
    &lt;/span&gt;&lt;span style="background: white; color: red;"&gt;Type&lt;/span&gt;&lt;span style="background: white; color: blue;"&gt;=&lt;/span&gt;&lt;span style="background: white; color: black;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="background: white; color: blue;"&gt;MyScheduledTask.ScheduledAgent&lt;/span&gt;&lt;span style="background: white; color: black;"&gt;&amp;quot; &lt;/span&gt;&lt;span style="background: white; color: blue;"&gt;/&amp;gt;
&amp;lt;/&lt;/span&gt;&lt;span style="background: white; color: rgb(163, 21, 21);"&gt;ExtendedTask&lt;/span&gt;&lt;span style="background: white; color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;


&lt;p&gt;It took me some time to figure out what the parameters in the BackgroundServiceAgent meant so:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Specifier&lt;/strong&gt; – ScheduledTaskAgent&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Name&lt;/strong&gt; – the string name you give your task when you start it. In the example below, it would be Name=MyAwesomeTask: &lt;/p&gt;

&lt;pre class="code"&gt;&lt;span style="background: white; color: rgb(43, 145, 175);"&gt;PeriodicTask &lt;/span&gt;&lt;span style="background: white; color: black;"&gt;myPeriodicTask = &lt;/span&gt;&lt;span style="background: white; color: blue;"&gt;new &lt;/span&gt;&lt;span style="background: white; color: rgb(43, 145, 175);"&gt;PeriodicTask&lt;/span&gt;&lt;span style="background: white; color: black;"&gt;(&lt;/span&gt;&lt;span style="background: white; color: rgb(163, 21, 21);"&gt;&amp;quot;MyAwesomeTask&amp;quot;&lt;/span&gt;&lt;span style="background: white; color: black;"&gt;);
&lt;/span&gt;&lt;span style="background: white; color: rgb(43, 145, 175);"&gt;ScheduledActionService&lt;/span&gt;&lt;span style="background: white; color: black;"&gt;.Add(myPeriodicTask);&lt;/span&gt;&lt;/pre&gt;


&lt;p&gt;&lt;strong&gt;Source&lt;/strong&gt; – 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.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Type&lt;/strong&gt; – the namespace.type notation that points to the actual object (which must inherit from ScheduledTaskAgent)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10384376" width="1" height="1"&gt;</content><author><name>MatthiasShapiro</name><uri>http://blogs.msdn.com/matthias.shapiro_4000_gmail.com/ProfileUrlRedirect.ashx</uri></author><category term="Windows Phone" scheme="http://blogs.msdn.com/b/matthiasshapiro/archive/tags/Windows+Phone/" /><category term="Windows Store" scheme="http://blogs.msdn.com/b/matthiasshapiro/archive/tags/Windows+Store/" /><category term="PeriodicTask" scheme="http://blogs.msdn.com/b/matthiasshapiro/archive/tags/PeriodicTask/" /><category term="ScheduledTaskAgent" scheme="http://blogs.msdn.com/b/matthiasshapiro/archive/tags/ScheduledTaskAgent/" /><category term="FileNotFoundException" scheme="http://blogs.msdn.com/b/matthiasshapiro/archive/tags/FileNotFoundException/" /></entry><entry><title>Weekly Links - January 7 2013</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/matthiasshapiro/archive/2013/01/07/weekly_2D00_links_2D00_january_2D00_7_2D00_2013.aspx" /><id>http://blogs.msdn.com/b/matthiasshapiro/archive/2013/01/07/weekly_2D00_links_2D00_january_2D00_7_2D00_2013.aspx</id><published>2013-01-07T20:13:42Z</published><updated>2013-01-07T20:13:42Z</updated><content type="html">&lt;h2&gt;Windows Phone &lt;/h2&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a href="http://www.wpcentral.com/mark-cuban-swaps-iphone-nokia-lumia-win-phone"&gt;Mark Cuban has a Nokia Lumia Windows Phone&lt;/a&gt; – and discusses this fact in standard Mark Cuban style, of course.&lt;/li&gt;    &lt;li&gt;&lt;a href="http://conversations.nokia.com/2013/01/02/where-to-buy-nfc-tags-and-how-to-edit-them/"&gt;Where to buy NFC tags and how to edit them&lt;/a&gt; (Adam Fraser) – Some great pointers to getting good NFC tags for sample development&lt;/li&gt;    &lt;li&gt;&lt;a href="http://nokiawpdev.wordpress.com/2013/01/02/registering-extensions/"&gt;Registering Extensions in Windows Phone&lt;/a&gt; – There are a lot of ways to get your app to integrate with other parts of the device in Windows Phone. Usually, this involves registering an extension (so the device knows to integrate your app appropriately). Here’s a step-by-step guide to doing so.&lt;/li&gt;    &lt;li&gt;&lt;a href="http://codeiuse.tumblr.com/post/39516610959/adding-a-flip-tile-fliptiledata-in-windows-phone-8"&gt;Adding a Flip Tile (FlipTileData) in Windows Phone 8&lt;/a&gt; (Matthias Shapiro)&lt;/li&gt;    &lt;li&gt;&lt;a href="http://matthiasshapiro.com/2013/01/03/windows-phone-8-amp-7-x-design-cheat-sheet/"&gt;Windows Phone 8 &amp;amp; 7.x Design Cheat Sheet&lt;/a&gt; (Nathalie Belval @nbelval) – A wonderful poster/card summarizing much of the important info for Windows Phone icons, colors, and screens.&lt;/li&gt;    &lt;li&gt;&lt;a href="http://codeiuse.tumblr.com/post/39595325665/get-the-geocoordinate-of-a-tap-on-the-map-control"&gt;Get the GeoCoordinate of a Tap on the Map Control in Windows Phone 8&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="http://proximitytapper.codeplex.com/"&gt;Proximity Tapper NFC sample for Windows Phone 8 &amp;amp; Windows 8&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="http://codeiuse.tumblr.com/post/39677660345/adding-tilting-in-windows-phone"&gt;Adding Tilt in Windows Phone&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt;  &lt;h2&gt;Windows 8&lt;/h2&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a href="http://www.jonathanantoine.com/2012/03/05/winjs-out-of-the-box-available-icons/"&gt;Using Windows 8 Metro icons from the font file&lt;/a&gt; (Jonathan Antione) -&amp;#160; Using the font “Segoe UI Symbol”, we can add Windows 8 icons to our apps. This also works in Windows Phone 8.&lt;/li&gt;    &lt;li&gt;&lt;a href="https://github.com/DavidBurela/WindowsMarketplaceIconMaker"&gt;Windows Store Icon Maker&lt;/a&gt; – create icons for Windows Store and Windows Phone 8 quickly and easily&lt;/li&gt; &lt;/ul&gt;  &lt;h2&gt;Design, Usability and Stuff&lt;/h2&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a href="http://codefoster.com/post/2012/06/28/designsheet.aspx"&gt;Windows 8 App Design Sheet&lt;/a&gt; (Jeremy Foster @codefoster) – I&amp;#160; much prefer starting my app brainstorms with a pencil and a design sheet rather than staring at a blank screen.&lt;/li&gt;    &lt;li&gt;&lt;a href="http://blog.xamarin.com/eight-reasons-c-sharp-is-the-best-language-for-mobile-development/"&gt;8 Reasons C# is the Best Language For Mobile Development&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.brainpickings.org/index.php/2012/12/27/chuck-close-on-creativity/"&gt;Chuck Close on Creativity, Work Ethic, and Problem-Solving vs. Problem Creating&lt;/a&gt; – “Inspiration is for amateurs - the rest of us just show up and get to work. And the belief that things will grow out of the activity itself and that you will - through work - bump into other possibilities and kick open other doors that you would never have dreamt of…”&lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.pbs.org/arts/gallery/off-book-%7C-season-two/offbook-creative-coding/"&gt;PBS short on Processing and Creative Coding&lt;/a&gt; (6 minute video)&lt;/li&gt;    &lt;li&gt;&lt;a href="http://game-icons.net/"&gt;1000 Gaming Icons&lt;/a&gt; – just because &lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.robertpenner.com/easing/penner_chapter7_tweening.pdf"&gt;Dynamic Visuals: Motion, Tweening, and Easing&lt;/a&gt;&amp;#160; - I love motion in UIs and @rainypixels recommended this very highly&lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.behance.net/gallery/Facebook-New-Look-Concept/6504647"&gt;Facebook as a clean Modern UI style&lt;/a&gt; – I always love these theoretical design excursions&lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.hackeducation.com/2013/01/06/lego-mindstorms-ev3/"&gt;Lego Mindstorms EV3&lt;/a&gt; – the next generation of Mindstorms. I’m pretty excited.&lt;/li&gt; &lt;/ul&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10382957" width="1" height="1"&gt;</content><author><name>MatthiasShapiro</name><uri>http://blogs.msdn.com/matthias.shapiro_4000_gmail.com/ProfileUrlRedirect.ashx</uri></author><category term="Windows Phone" scheme="http://blogs.msdn.com/b/matthiasshapiro/archive/tags/Windows+Phone/" /><category term="C#" scheme="http://blogs.msdn.com/b/matthiasshapiro/archive/tags/C_2300_/" /><category term="Windows 8" scheme="http://blogs.msdn.com/b/matthiasshapiro/archive/tags/Windows+8/" /><category term="Lego" scheme="http://blogs.msdn.com/b/matthiasshapiro/archive/tags/Lego/" /><category term="NFC" scheme="http://blogs.msdn.com/b/matthiasshapiro/archive/tags/NFC/" /><category term="Facebook" scheme="http://blogs.msdn.com/b/matthiasshapiro/archive/tags/Facebook/" /><category term="Geolocation" scheme="http://blogs.msdn.com/b/matthiasshapiro/archive/tags/Geolocation/" /><category term="Processing" scheme="http://blogs.msdn.com/b/matthiasshapiro/archive/tags/Processing/" /></entry><entry><title>Windows Phone 8 &amp; 7.x Design Cheat Sheet</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/matthiasshapiro/archive/2013/01/03/windows-phone-8-amp-7-x-design-cheat-sheet.aspx" /><id>http://blogs.msdn.com/b/matthiasshapiro/archive/2013/01/03/windows-phone-8-amp-7-x-design-cheat-sheet.aspx</id><published>2013-01-03T18:30:08Z</published><updated>2013-01-03T18:30:08Z</updated><content type="html">&lt;p&gt;I tweeted this, but it is so fantastic it needed its own blog post.&lt;/p&gt;  &lt;p&gt;Nathalie BELVAL (&lt;a href="http://twitter.com/nbelval"&gt;@nbelval&lt;/a&gt;) &lt;a href="http://devndesign.fr/2012/12/windows-phone-memo-modernui-pour-faire-de-belles-applications-sur-windows-phone-7-8/"&gt;put together this handy card&lt;/a&gt; for designing and developing apps for Windows Phone 7.x and Windows Phone 8. It contains all the information you might need for:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Resolutions in Windows Phone 7 &amp;amp; 8 &lt;/li&gt;    &lt;li&gt;Application assets (screenshots, splash screens, application icons, etc)&lt;/li&gt;    &lt;li&gt;Accent colors&lt;/li&gt;    &lt;li&gt;Available icons&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Download it, print it, love it.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://devndesign.fr/wp-content/uploads/2012/12/MemoWindowsPhoneAppGUIDELINES.png"&gt;&lt;img title="image" style="border: 0px currentcolor; padding-top: 0px; padding-right: 0px; padding-left: 0px; 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/0066.image_5F00_2DE5548C.png" width="631" height="448" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Thanks to &lt;a href="http://twitter.com/winphonegeek"&gt;@winphonegeek&lt;/a&gt; for finding this.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10382155" width="1" height="1"&gt;</content><author><name>MatthiasShapiro</name><uri>http://blogs.msdn.com/matthias.shapiro_4000_gmail.com/ProfileUrlRedirect.ashx</uri></author><category term="Windows Phone" scheme="http://blogs.msdn.com/b/matthiasshapiro/archive/tags/Windows+Phone/" /><category term="Windows Phone 7" scheme="http://blogs.msdn.com/b/matthiasshapiro/archive/tags/Windows+Phone+7/" /><category term="Windows Phone 8" scheme="http://blogs.msdn.com/b/matthiasshapiro/archive/tags/Windows+Phone+8/" /><category term="Design" scheme="http://blogs.msdn.com/b/matthiasshapiro/archive/tags/Design/" /></entry><entry><title>Weekly Links–New Year 2013 Edition!</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/matthiasshapiro/archive/2013/01/02/weekly-links-new-year-2013-edition.aspx" /><id>http://blogs.msdn.com/b/matthiasshapiro/archive/2013/01/02/weekly-links-new-year-2013-edition.aspx</id><published>2013-01-02T17:45:17Z</published><updated>2013-01-02T17:45:17Z</updated><content type="html">&lt;h2&gt;Windows Phone&lt;/h2&gt;  &lt;p&gt;&lt;a href="http://www.theverge.com/2012/12/25/3793462/best-apps-new-windows-phone/in/3566737"&gt;Best Apps For Your New Windows Phone Device&lt;/a&gt; – not at all comprehensive, but a decent starting point.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.developer.nokia.com/Resources/Library/Lumia/#!maps-tutorial.html;#toc_Searchingforanaddress"&gt;Reverse GeoCode for Windows Phone 8&lt;/a&gt; – Give the Nokia Map control in Windows Phone 8 a lat/lon and get an address. Must attempt.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blog.brilliantvision.de/index.php/how-to-create-a-windows-phone-live-tile-in-the-style-of-the-people-hub/"&gt;Create a Windows Phone Live Tile In the People Hub Style&lt;/a&gt; &lt;/p&gt;  &lt;h2&gt;Design and Usability&lt;/h2&gt;  &lt;p&gt;&lt;a href="http://www.sesameworkshop.org/our-blog/2012/12/17/sesames-best-practices-guide-for-childrens-app-development/"&gt;Sesame’s Best Practices Guide for Children’s App Development&lt;/a&gt; – A very cool guide to touch-screen tablet based app development aimed at kids under 5 or 6.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lunatractor.com/2012/12/16/software_design_lego/"&gt;What software people can learn from great Lego design&lt;/a&gt; – pretty high level but very interesting look into design, customer feedback and usability.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://mobileosgeek.com/how-to-detect-kids-corner-programmatically-in-windows-phone-8/"&gt;Detect Kids Corner Programmatically in Windows Phone 8&lt;/a&gt;&lt;/p&gt;  &lt;h2&gt;Other Stuff&lt;/h2&gt;  &lt;p&gt;&lt;a href="http://www.education.rec.ri.cmu.edu/previews/robot_c_products/teaching_rc_lego_v2_preview/"&gt;Teaching ROBOTC for Lego Mindstorms&lt;/a&gt; - A guide to Lego Mindstorms from Carnegie Mellon Robotics Academy&lt;/p&gt;  &lt;p&gt;&lt;a href="http://mikecanex.wordpress.com/2012/12/26/1922-why-i-quit-being-so-accommodating/"&gt;Why I Quit Being So Accommodating&lt;/a&gt; – from 1922, an essay from a gentleman who resolved to no longer be known as “’General Attender to Things,’ or ‘Pinch Hitter,’ or ‘Fine Old Scout.’” Filed under “the more things change the more they stay the same”.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10381858" width="1" height="1"&gt;</content><author><name>MatthiasShapiro</name><uri>http://blogs.msdn.com/matthias.shapiro_4000_gmail.com/ProfileUrlRedirect.ashx</uri></author><category term="Windows Phone" scheme="http://blogs.msdn.com/b/matthiasshapiro/archive/tags/Windows+Phone/" /><category term="C#" scheme="http://blogs.msdn.com/b/matthiasshapiro/archive/tags/C_2300_/" /><category term="Windows Phone 8" scheme="http://blogs.msdn.com/b/matthiasshapiro/archive/tags/Windows+Phone+8/" /><category term="Weekly Links" scheme="http://blogs.msdn.com/b/matthiasshapiro/archive/tags/Weekly+Links/" /></entry></feed>