<?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">Pla.NET Southeast!</title><subtitle type="html">Developer happenings in Georgia, Alabama and Mississippi</subtitle><id>http://blogs.msdn.com/b/glengordon/atom.aspx</id><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/glengordon/" /><link rel="self" type="application/atom+xml" href="http://blogs.msdn.com/b/glengordon/atom.aspx" /><generator uri="http://telligent.com" version="5.6.583.20496">Telligent Community 5.6.583.20496 (Build: 5.6.583.20496)</generator><updated>2011-06-09T14:12:56Z</updated><entry><title>Join the 30 to Launch challenge and build a Windows Phone application today!</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/glengordon/archive/2012/02/01/join-the-30-to-launch-challenge-and-build-a-windows-phone-application-today.aspx" /><id>http://blogs.msdn.com/b/glengordon/archive/2012/02/01/join-the-30-to-launch-challenge-and-build-a-windows-phone-application-today.aspx</id><published>2012-02-01T20:30:40Z</published><updated>2012-02-01T20:30:40Z</updated><content type="html">&lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-31-52-metablogapi/3771.clip_5F00_image001_5F00_2.jpg"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image001" border="0" alt="clip_image001" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-31-52-metablogapi/4353.clip_5F00_image001_5F00_thumb.jpg" width="566" height="252" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Lots of things are tough to do in 30 days. Having a baby, building a skyscraper, shooting a movie.&lt;/p&gt;  &lt;p&gt;One thing that’s dead easy though? Creating a Windows Phone application.&lt;/p&gt;  &lt;p&gt;To that end, we’ve launched a new campaign designed to help you be successful doing just that. It’s called &lt;strong&gt;30 to Launch&lt;/strong&gt;. From January 31 to February 29 (yes, you even get an extra day this year) learn about developing for Windows Phone. In Week 2, you’ll have a chance to request a token to register for App Hub for free to publish your apps. In week 3 you could win a Nokia Lumia 800 phone - to test your app of course! :)&lt;/p&gt;  &lt;p&gt;Winners of the 30 to launch program have a chance to win a 3D TV, and Xbox Kinect, and more. Plus you’ll have the satisfaction of having brought a cool app into existence and sharing it with the world in the Windows Phone marketplace!&lt;/p&gt;  &lt;p&gt;Are you in? Sign up today at &lt;a href="http://www.30tolaunch.com"&gt;www.30tolaunch.com&lt;/a&gt; to join the challenge.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10262943" width="1" height="1"&gt;</content><author><name>GlenGordon</name><uri>http://blogs.msdn.com/glengordon/ProfileUrlRedirect.ashx</uri></author></entry><entry><title>Get help with your Windows Phone apps at the Phone Garage in Birmingham–February 18</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/glengordon/archive/2012/01/26/get-help-with-your-windows-phone-apps-at-the-phone-garage-in-birmingham-february-18.aspx" /><id>http://blogs.msdn.com/b/glengordon/archive/2012/01/26/get-help-with-your-windows-phone-apps-at-the-phone-garage-in-birmingham-february-18.aspx</id><published>2012-01-26T20:51:05Z</published><updated>2012-01-26T20:51:05Z</updated><content type="html">&lt;p&gt;What's a Windows Phone Garage?&lt;/p&gt;  &lt;p&gt;A free, full day event being designed to help developers/designers build Windows Phone applications. Whether you're a seasoned veteran or just getting started with .NET development this full-day event is for you. Not sure how to turn an idea into an app? Our local Windows Phone, Silverlight and .NET experts will be on hand to answer questions, share code and give guidance.&lt;/p&gt;  &lt;p&gt;We will also have devices on hand for you to test your app throughout the day to make sure it performs well on Windows Phone hardware.   &lt;br /&gt;This is the perfect opportunity to begin work on your dream application, or finish that app you've already started, with Windows Phone experts there to guide you every step of the way. Bring your own laptop to join in the fun and show off your killer app! &lt;/p&gt;  &lt;p&gt;Agenda&lt;/p&gt;  &lt;p&gt;There is no set agenda. Community experts will provide impromptu sessions based on attendee questions/requests. Lunch and a light breakfast will be provided. &lt;/p&gt;  &lt;p&gt;Prerequisites&lt;/p&gt;  &lt;p&gt;Bring a notebook computer and identification. Also check out the APP HUB where you can &lt;a href="http://create.msdn.com/en-us/home/getting_started"&gt;&lt;u&gt;get developer tools&lt;/u&gt;&lt;/a&gt;, &lt;a href="http://msdn.microsoft.com/en-us/library/ff402551(v=VS.92).aspx"&gt;&lt;u&gt;learn about application features&lt;/u&gt;&lt;/a&gt;, &lt;a href="http://msdn.microsoft.com/en-us/library/ff967556(v=VS.92).aspx"&gt;&lt;u&gt;understand common task for Apps&lt;/u&gt;&lt;/a&gt; and &lt;a href="http://create.msdn.com/en-us/home/membership"&gt;&lt;u&gt;register and load your APP&lt;/u&gt;&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;Sign up for the garage at &lt;a title="http://birminghamwpgarage.eventbrite.com/" href="http://birminghamwpgarage.eventbrite.com/"&gt;http://birminghamwpgarage.eventbrite.com/&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10260991" width="1" height="1"&gt;</content><author><name>GlenGordon</name><uri>http://blogs.msdn.com/glengordon/ProfileUrlRedirect.ashx</uri></author></entry><entry><title>Alabama Code Camp 9–March 10 in Troy, AL</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/glengordon/archive/2012/01/26/alabama-code-camp-9-march-10-in-troy-al.aspx" /><id>http://blogs.msdn.com/b/glengordon/archive/2012/01/26/alabama-code-camp-9-march-10-in-troy-al.aspx</id><published>2012-01-26T15:20:40Z</published><updated>2012-01-26T15:20:40Z</updated><content type="html">&lt;p&gt;The industrious developer community over in Alabama has just announced their 9th code camp, taking place this coming March 10th in Troy.&lt;/p&gt;  &lt;p&gt;If you want a fantastic day of free training, networking with some great folks, and a lot of geek fun, make plans to attend. They need speakers too! So try your hand at even a simple presentation on a topic you’re interested in.&lt;/p&gt;  &lt;p&gt;Save the date on your calendar, and get all the information at &lt;a title="http://www.alabamacodecamp.com/" href="http://www.alabamacodecamp.com/"&gt;http://www.alabamacodecamp.com/&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10260885" width="1" height="1"&gt;</content><author><name>GlenGordon</name><uri>http://blogs.msdn.com/glengordon/ProfileUrlRedirect.ashx</uri></author></entry><entry><title>Excellent ASP.NET MVC3, HTML5 and jQuery training in Atlanta</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/glengordon/archive/2012/01/12/excellent-asp-net-mvc3-html5-and-jquery-training-in-atlanta.aspx" /><id>http://blogs.msdn.com/b/glengordon/archive/2012/01/12/excellent-asp-net-mvc3-html5-and-jquery-training-in-atlanta.aspx</id><published>2012-01-12T16:48:44Z</published><updated>2012-01-12T16:48:44Z</updated><content type="html">&lt;p&gt;If you have been wanting in-depth in-person training on ASP.NET MVC3, HTML5 and jQuery in Atlanta , check out &lt;a href="http://twitter.com/ShawnWildermuth"&gt;Shawn Wildermuth&lt;/a&gt;’s upcoming class on building applications on the Microsoft web platform. Here is the outline for the class:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;This workshop is a 3-day class that features an in depth look at ASP.NET MVC3 and HTML5. ASP.NET MVC3 is the third iteration of the Model/View/Controller pattern as implemented by the ASP.NET team. In this course, you’ll learn how the next web is going to be created on the Microsoft platform. &lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;The class will be held February 27-29. &lt;a href="https://agilitrain.com/workshop/eventinfo/280"&gt;Register today&lt;/a&gt; because early bird pricing ends January 30!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10256000" width="1" height="1"&gt;</content><author><name>GlenGordon</name><uri>http://blogs.msdn.com/glengordon/ProfileUrlRedirect.ashx</uri></author></entry><entry><title>PhoneGap on WP7 Tip #5: Live Tiles and Deep Linking</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/glengordon/archive/2012/01/10/phonegap-on-wp7-tip-5-live-tiles-and-deep-linking.aspx" /><id>http://blogs.msdn.com/b/glengordon/archive/2012/01/10/phonegap-on-wp7-tip-5-live-tiles-and-deep-linking.aspx</id><published>2012-01-10T20:32:42Z</published><updated>2012-01-10T20:32:42Z</updated><content type="html">&lt;p&gt;Windows Phone has a unique and very handy way of providing multiple entry points into your application. This is done through the use of one or more Live Tiles. The start screen on Windows Phone is comprised of tiles that represent many things – applications, people, websites, music, map locations, and more. &lt;/p&gt;  &lt;p&gt;There’s a neat way to get a feel for this UI metaphor even if you don’t have a Windows Phone or the emulator installed. Point your iOS or Android device to &lt;a href="http://m.microsoft.com/windowsphone/en-us/demo/"&gt;http://m.microsoft.com/windowsphone/en-us/demo/&lt;/a&gt; and you can see the tiles in action.&lt;/p&gt;  &lt;p&gt;When you have an application on Windows Phone, one of the best compliments that a user can give your app is to pin it to their start screen. And the cooler your application tile, the more your users will like and use your application. With Windows Phone 7.5, you can now have multiple tiles representing multiple entry points for your application pinned to the user’s start screen. Check it out in this quick video of FourSquare on Windows Phone. FourSquare allows you to pin locations and people to the start screen for quick access.&lt;/p&gt;  &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:5737277B-5D6D-4f48-ABFC-DD9C333F4C5D:fa1cf686-3955-45b6-aa47-843d12f75f63" class="wlWriterEditableSmartContent"&gt;&lt;div&gt;&lt;object width="448" height="252"&gt;&lt;param name="movie" value="http://www.youtube.com/v/8C9UhDHbl78?hl=en&amp;amp;hd=1"&gt;&lt;/param&gt;&lt;embed src="http://www.youtube.com/v/8C9UhDHbl78?hl=en&amp;amp;hd=1" type="application/x-shockwave-flash" width="448" height="252"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;/div&gt;&lt;/div&gt;  &lt;p&gt;A common example of using multiple Live Tiles is a weather application. The user’s start screen might have a tile for each location for which they want to access the weather quickly. Each tile represents a different location, and when the user launches the app from each tile, the application responds by going straight to the details page for that city. This is a huge timesaver for the user.&lt;/p&gt;  &lt;p&gt;Not only can the tiles represent multiple entry points into your application, but each tile can surface a small amount of data to the end user from your application, with different images and text being shown on each tile. In the case of a weather app, each city’s tile could display the current conditions or forecast, maps, and more for that city. Live Tiles also have this cool flipping effect, so you can even put things on the back of each tile like secondary images or text. The tile will flip over randomly, making for a dynamic start screen that users really get a kick out of.&lt;/p&gt;  &lt;p&gt;You can manage your application’s Live Tiles from within the app’s code. And since a PhoneGap application runs within a Silverlight application, you could write some C# or Visual Basic code to create, change, or remove the tiles. But there’s an even easier way. Check out the &lt;a href="https://github.com/purplecabbage/phonegap-plugins/tree/master/WindowsPhone/LiveTiles"&gt;Live Tile plugin&lt;/a&gt; on &lt;a href="https://github.com/purplecabbage/phonegap-plugins/tree/master/WindowsPhone"&gt;Jesse MacFadyen’s plugin page&lt;/a&gt;. It provides a simple way to create and update tiles from within the JavaScript of a PhoneGap application.&lt;/p&gt;  &lt;p&gt;Here is some code from the sample page that shows how to create a secondary tile:&lt;/p&gt;  &lt;div id="codeSnippetWrapper"&gt;   &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;     &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;function&lt;/span&gt; createSecondaryTile() {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    console.log(&lt;span style="color: #006080"&gt;'Create secondary tile'&lt;/span&gt;);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&amp;#160;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;var&lt;/span&gt; success = &lt;span style="color: #0000ff"&gt;function&lt;/span&gt; (res) {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;        console.log(&lt;span style="color: #006080"&gt;'secondary tile was created'&lt;/span&gt;);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;        document.getElementById(&lt;span style="color: #006080"&gt;'res'&lt;/span&gt;).innerHTML = res;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    };&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&amp;#160;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;var&lt;/span&gt; fail = &lt;span style="color: #0000ff"&gt;function&lt;/span&gt; (e) {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;        console.log(&lt;span style="color: #006080"&gt;&amp;quot;Error occurred: &amp;quot;&lt;/span&gt; + e);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;        document.getElementById(&lt;span style="color: #006080"&gt;'res'&lt;/span&gt;).innerHTML = &lt;span style="color: #006080"&gt;&amp;quot;Error occurred: &amp;quot;&lt;/span&gt; + e;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    };&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    navigator.plugins.liveTiles.createSecondaryTile(success, fail, &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;     { title: document.getElementById(&lt;span style="color: #006080"&gt;'title'&lt;/span&gt;).value, &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;       image: &lt;span style="color: #006080"&gt;'Images/appbar.save.rest.png'&lt;/span&gt;, &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;       count: document.getElementById(&lt;span style="color: #006080"&gt;'count'&lt;/span&gt;).value, &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;       secondaryTileUri: secondaryTile, &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;       backTitle: &lt;span style="color: #006080"&gt;'back'&lt;/span&gt; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;     });&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;};&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;The key call in here is to &lt;strong&gt;navigator.plugins.liveTiles.createSecondaryTile&lt;/strong&gt;. This code sets up the image, count and title to control how the tile appears, which are useful. But the key to making the secondary tile a deep link to someplace in your application is in the &lt;strong&gt;SecondaryTileUri&lt;/strong&gt; parameter.&lt;/p&gt;

&lt;p&gt;Normally that URI contains two things that a Windows Phone app cares about – the &lt;em&gt;page&lt;/em&gt; to be navigated to (a XAML page in the project) and some &lt;em&gt;parameter&lt;/em&gt; to be sent to the page, like the zip code of the city whose weather to display. These are formed just like a web based HTTP request. In Windows Phone app, the XAML part of the URI is automatically navigated to, and you can write code in C# or VB to retrieve the querystring parameters to get what you need.&lt;/p&gt;

&lt;p&gt;Now, in our case what we want to do is go to the same XAML page each time (the one hosting the PhoneGap application) and navigate to a different HTML page &lt;em&gt;within&lt;/em&gt; the PhoneGap file structure. So we just need to provide the proper URI to that HTML page as a querystring parameter at the end of the XAML page’s name in the URI we assign to that tile. Fortunately the plugin handles the XAML page part, and you just specify the HTML page to navigate to. In the code above the &lt;strong&gt;secondaryTile&lt;/strong&gt; variable is set earlier in the code.&lt;/p&gt;

&lt;div id="codeSnippetWrapper"&gt;
  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;
    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;var&lt;/span&gt; secondaryTile = &lt;span style="color: #006080"&gt;'www/liveTiles.html'&lt;/span&gt;;&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;This is added to the end of the URI for the tile.&lt;/p&gt;

&lt;p&gt;While the plugin is useful, it’s missing one key part. Specifically, it doesn’t contain a way for the PhoneGap application to navigate to the proper HTML page when it is activated from a tile that has a deep link URI. So you’re going to need to put a little code in the hosting XAML page, and actually tweak the secondaryTile variable in the sample to get it to work.&lt;/p&gt;

&lt;p&gt;If you’ve created a project from the PhoneGap template, open MainPage.xaml.cs. Inside the constructor method (which starts off with &lt;strong&gt;public MainPage&lt;/strong&gt;), type &lt;strong&gt;Loaded += &lt;/strong&gt;then hit Tab twice. This will create a MainPage_Loaded event handler. Change that to be the following:&lt;/p&gt;

&lt;div id="codeSnippetWrapper"&gt;
  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;
    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;void&lt;/span&gt; MainPage_Loaded(&lt;span style="color: #0000ff"&gt;object&lt;/span&gt; sender, RoutedEventArgs e)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;{&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;try&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;        &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; pgUri = &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.NavigationContext.QueryString[&lt;span style="color: #006080"&gt;&amp;quot;Uri&amp;quot;&lt;/span&gt;];&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;        PGView.Browser.Navigate(&lt;span style="color: #0000ff"&gt;new&lt;/span&gt; Uri(pgUri, UriKind.RelativeOrAbsolute));&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;catch&lt;/span&gt; { };   &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;}&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;This code will pull the HTML page off of the end of the URI and send the PhoneGap control’s browser off to that page. We wrap it in a try/catch in case there’s no URI or the Navigate fails.&lt;/p&gt;

&lt;p&gt;The final thing to do is change the URI of the HTML page so it has the correct URI for the desired HTML page. Revisit the liveTilesExample.html page and change the &lt;strong&gt;secondaryTile&lt;/strong&gt; variable to be this:&lt;/p&gt;

&lt;div id="codeSnippetWrapper"&gt;
  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;
    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;var&lt;/span&gt; secondaryTile = &lt;span style="color: #006080"&gt;'app/www/liveTilesExample.html'&lt;/span&gt;;&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;Now run the project, click on Live Tiles page, and create a secondary tile. That should bring you back to the start screen and show the secondary tile. If you tap on the tile, it should launch the app and navigate to the Live Tiles page instead of the main page. Press the Windows key at the bottom, swipe to the right and you’ll see the main icon for the application. Launching the app from there will go to the index.html page and not the live tile page. If you press and hold that icon, you can pin it to start, and now you’ll have the main tile for the app as well as the secondary tile.&lt;/p&gt;

&lt;p&gt;One thing I’m finding a challenge is passing a parameter into the HTML page. So if your page was showWeather.html and you wanted to send in a zip code, I’m finding that you can’t simply append ?zipcode=90210 at the end of the HTML page – it won’t work, although you can still make it part of the tile’s URI. I’m working on a tip for handling that, so look for a future blog post about it.&lt;/p&gt;

&lt;p&gt;I encourage you to explore all the things you can do with Live Tiles now that you have a way to use them easily from PhoneGap. Here’s a &lt;a href="http://msdn.microsoft.com/en-us/library/hh202948(v=VS.92).aspx"&gt;useful article on MSDN&lt;/a&gt; on what you can do with them. Have fun with Live Tiles!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10255273" width="1" height="1"&gt;</content><author><name>GlenGordon</name><uri>http://blogs.msdn.com/glengordon/ProfileUrlRedirect.ashx</uri></author><category term="PhoneGap" scheme="http://blogs.msdn.com/b/glengordon/archive/tags/PhoneGap/" /></entry><entry><title>PhoneGap 1.3 released, full support for Windows Phone</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/glengordon/archive/2011/12/19/phonegap-1-3-released-full-support-for-windows-phone.aspx" /><id>http://blogs.msdn.com/b/glengordon/archive/2011/12/19/phonegap-1-3-released-full-support-for-windows-phone.aspx</id><published>2011-12-19T21:12:36Z</published><updated>2011-12-19T21:12:36Z</updated><content type="html">&lt;p&gt;This morning the &lt;a href="http://phonegap.com/"&gt;PhoneGap&lt;/a&gt; community announced their version 1.3 release! This release is special because it’s the first one to include support for Windows Phone. And not just a little support, but all the main PhoneGap features.&lt;/p&gt;  &lt;p&gt;For those of you with PhoneGap experience or even just a heavy HTML5 background, this will be an excellent way to reach the growing audience of Windows Phone users with your applications. And because of the way PhoneGap is implemented on Windows Phone, it means you can add features and UI elements *outside* of the PhoneGap UI to round out your application as a full featured Windows Phone app!&lt;/p&gt;  &lt;p&gt;Read the &lt;a href="http://blogs.technet.com/b/port25/archive/2011/12/19/full-support-for-phonegap-on-windows-phone-is-now-complete.aspx"&gt;announcement on our interoperability blog&lt;/a&gt;, and download the framework from &lt;a href="https://github.com/callback/callback-windows-phone"&gt;here&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10249352" width="1" height="1"&gt;</content><author><name>GlenGordon</name><uri>http://blogs.msdn.com/glengordon/ProfileUrlRedirect.ashx</uri></author><category term="PhoneGap" scheme="http://blogs.msdn.com/b/glengordon/archive/tags/PhoneGap/" /></entry><entry><title>Great Windows Azure announcements and fresh content!</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/glengordon/archive/2011/12/19/great-windows-azure-announcements-and-fresh-content.aspx" /><id>http://blogs.msdn.com/b/glengordon/archive/2011/12/19/great-windows-azure-announcements-and-fresh-content.aspx</id><published>2011-12-19T18:33:00Z</published><updated>2011-12-19T18:33:00Z</updated><content type="html">&lt;p&gt;&lt;a href="http://r.ch9.ms/LearnWA"&gt;&lt;img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;" title="clip_image001" border="0" alt="clip_image001" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-31-52-metablogapi/6685.clip_5F00_image001_5F00_3.jpg" width="362" height="374" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;One of the downsides of finding videos and articles on the Web is that they can get out of date (to varying degrees) over time. So it&amp;rsquo;s always exciting to me when fresh material comes around, especially in conjunction with new announcements and especially from the product teams themselves.&lt;/p&gt;
&lt;p&gt;So is the case with the latest round of Windows Azure videos and materials online. All the videos located at &lt;a href="http://r.ch9.ms/LearnWA"&gt;http://r.ch9.ms/LearnWA&lt;/a&gt; will give you what you need to get started. Read about all the amazing features in the &lt;a href="http://blogs.msdn.com/b/windowsazure/archive/2011/12/12/improved-developer-experience-interoperability-and-scalability-on-windows-azure.aspx"&gt;December release&lt;/a&gt; including Node.js and Hadoop support (watch some &lt;a href="http://channel9.msdn.com/Events/windowsazure/learn?sort=sequential&amp;amp;direction=desc&amp;amp;page=3"&gt;videos covering that&lt;/a&gt;), easier subscription management, new scaling options for SQL Azure, and more.&lt;/p&gt;
&lt;p&gt;Then, go play in the cloud using the &lt;a href="http://www.microsoft.com/click/services/Redirect2.ashx?CR_CC=200063231"&gt;Free Trial&lt;/a&gt;, now with &lt;a href="http://www.windowsazure.com/en-us/pricing/spending-limits"&gt;spending caps&lt;/a&gt; to ensure you have no out of pocket costs to worry about. And since with Windows Azure you can build and run cloud solutions locally on the exact same platform as in the cloud, go get the SDKs. The &lt;b&gt;&lt;i&gt;new&lt;/i&gt;&lt;/b&gt; site has a &lt;a href="http://www.microsoft.com/click/services/Redirect2.ashx?CR_CC=200063247"&gt;tremendous collection of SDKs and guidance&lt;/a&gt; to help you get started.&lt;/p&gt;
&lt;p&gt;So what are you waiting for? You now have plenty of information to get started and write your very own Azure service. Take some time between presents and meals to kick back with some cloud coding!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10249299" width="1" height="1"&gt;</content><author><name>GlenGordon</name><uri>http://blogs.msdn.com/glengordon/ProfileUrlRedirect.ashx</uri></author><category term="Windows Azure" scheme="http://blogs.msdn.com/b/glengordon/archive/tags/Windows+Azure/" /></entry><entry><title>PhoneGap on WP7 Tip #4: The Application Bar</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/glengordon/archive/2011/12/14/phonegap-on-wp7-tip-4-the-application-bar.aspx" /><id>http://blogs.msdn.com/b/glengordon/archive/2011/12/14/phonegap-on-wp7-tip-4-the-application-bar.aspx</id><published>2011-12-14T16:33:13Z</published><updated>2011-12-14T16:33:13Z</updated><content type="html">&lt;p&gt;“So two applications walk into a bar…”&lt;/p&gt;  &lt;p&gt;One of the user interface constructs that’s unique to Windows Phone is the Application Bar. The App Bar (as we affectionately call it) gives users a standard place to find buttons for commonly used tasks within an application, and menus for lesser used but still necessary tasks. &lt;/p&gt;  &lt;p&gt;Here’s a screenshot of the Search screen where you can see the App Bar at the bottom.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-31-52-metablogapi/6663.appbar1_5F00_2.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="appbar1" border="0" alt="appbar1" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-31-52-metablogapi/3058.appbar1_5F00_thumb.png" width="148" height="244" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;While it’s possible to create something inside your HTML in PhoneGap that mimics the look and behavior of the native one, in my opinion it makes more sense to use the native Windows Phone one since it’s already there. There are a lot of advantages to using the native App Bar:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;It doesn’t scroll with your content. &lt;/li&gt;    &lt;li&gt;It automatically rotates the icons when the user changes from portrait to landscape orientation. &lt;/li&gt;    &lt;li&gt;It will recolor the icons if the user switches between light and dark themes. &lt;/li&gt;    &lt;li&gt;The buttons have descriptions to help the user realize what they are for. &lt;/li&gt;    &lt;li&gt;It will make your application look like it belongs on Windows Phone! &lt;/li&gt; &lt;!--EndFragment--&gt;&lt;/ul&gt;  &lt;p&gt;Because of the ability to communicate between the hosting Silverlight page and the HTML content in the PhoneGap control, you can do all the coding for the button or menu functionality in JavaScript and just invoke those functions when the button is clicked. &lt;/p&gt;  &lt;p&gt;Start by creating a new project using the GapAppStarter template I described in &lt;a href="http://blogs.msdn.com/b/glengordon/archive/2011/11/16/phonegap-on-wp7-tip-1-handling-orientation.aspx"&gt;Tip #1&lt;/a&gt;.&amp;#160; We’re going to add the icon for the button to the project. There are several that can be found on your system after you install the Windows Phone developer tools. They’re stored in your Program Files folder (typically C:\Program Files (x86)\Microsoft SDKs\Windows Phone\v7.1\Icons). Create a folder in the project called Icons (right click on the project in Solution Explorer and chose Add, New Folder. Let’s call it Icons. Then, right click on the Icons folder and choose Add Existing Item. Browse to the Dark folder beneath the one mentioned above and pick your favorite. I’m using the refresh icon. Make sure you click on the png file and, in the Properties window, change Build Action to Content. &lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-31-52-metablogapi/2134.image_5F00_2.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-31-52-metablogapi/5280.image_5F00_thumb.png" width="244" height="169" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Now we’re ready to add the App Bar to the page. Open up mainpage.xaml and scroll to the bottom in source view. Add this XAML in below the &amp;lt;/Grid&amp;gt; tag. &lt;/p&gt;  &lt;div id="codeSnippetWrapper"&gt;   &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;     &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;phone:PhoneApplicationPage.ApplicationBar&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;shell:ApplicationBar&lt;/span&gt; &lt;span style="color: #ff0000"&gt;IsVisible&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;True&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;IsMenuEnabled&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;True&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;Opacity&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;0.5&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;        &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;shell:ApplicationBarIconButton&lt;/span&gt; &lt;span style="color: #ff0000"&gt;IconUri&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;/icons/appbar.refresh.rest.png&amp;quot;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;        &lt;span style="color: #ff0000"&gt;x:Name&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;AppbarButtonRefresh&amp;quot;&lt;/span&gt;  &lt;span style="color: #ff0000"&gt;Text&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;Refresh&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;shell:ApplicationBar&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;phone:PhoneApplicationPage.ApplicationBar&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;This will result in an App Bar having 50% opacity, with one button on it. If you want more buttons, just add more ApplicationBarIconButton lines. If you run the app in the emulator, you’ll see the button on the App Bar at the bottom. In addition to ApplicationBarIconButtons you could also add ApplicationBarMenuItems which show up when the user expands the App Bar by tapping the ellipses. &lt;/p&gt;

&lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-31-52-metablogapi/4532.appbar2_5F00_2.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="appbar2" border="0" alt="appbar2" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-31-52-metablogapi/2068.appbar2_5F00_thumb.png" width="192" height="318" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Clicking the button doesn’t do anything yet, so let’s add the code. First, inside the PhoneGap portion, let’s add some JavaScript to call. Here’s an example.&lt;/p&gt;

&lt;div id="codeSnippetWrapper"&gt;
  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;
    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;function&lt;/span&gt; appbar_refresh() {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;var&lt;/span&gt; currentTime = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; Date();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    document.getElementById(&lt;span style="color: #006080"&gt;&amp;quot;welcomeMsg&amp;quot;&lt;/span&gt;).innerHTML = &lt;span style="color: #006080"&gt;&amp;quot;You clicked refresh at &amp;quot;&lt;/span&gt; + currentTime.toString();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    }&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;To call this from our Silverlight code, just add an event handler for the button in XAML and put some code in. Go back to the MainPage.xaml page, put your cursor just inside the closing tag /&amp;gt; for the ApplicationBarIconButton element, type &lt;strong&gt;Click=&lt;/strong&gt; and chose &lt;strong&gt;New Event Handler&lt;/strong&gt; from the dropdown. Then in the C# code, just pass control into your JavaScript by typing &lt;strong&gt;PGView.Browser.InvokeScript(&amp;quot;appbar_refresh&amp;quot;);&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Run the project again, and every time you click the button, the time should update on the page. Note that in this approach, we’re putting all the logic to handle the button click in JavaScript, so if you have the same PhoneGap application on other platforms, you would just need buttons in the HTML in that version to invoke that functionality.&lt;/p&gt;

&lt;p&gt;If you want to experience the App Bar in landscape mode, just follow the instructions in &lt;a href="http://blogs.msdn.com/b/glengordon/archive/2011/11/16/phonegap-on-wp7-tip-1-handling-orientation.aspx"&gt;Tip #1&lt;/a&gt; to make your application able to rotate when the user changes device orientation. The app bar will automatically adjust for landscape. You will note that in Landscape the App Bar is covering part of the PhoneGap output. You could adjust that by changing the layout within the HTML when the screen rotates. But it’s useful here because here we get to see the semi-opacity of the bar as we configured it.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-31-52-metablogapi/3058.appbar3_5F00_2.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="appbar3" border="0" alt="appbar3" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-31-52-metablogapi/7762.appbar3_5F00_thumb.png" width="417" height="252" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It’s worth mentioning that sometimes applications need to change the App Bar, like hiding it, changing or hiding or disabling buttons or menus, etc. You can create an event handler for the ScriptNotify event as in &lt;a href="http://blogs.msdn.com/b/glengordon/archive/2011/11/21/phonegap-on-wp7-tip-2-script-interaction.aspx"&gt;Tip #2&lt;/a&gt; and invoke that from JavaScript to manipulate the App Bar. The steps for manipulating the App Bar in code can be found in this &lt;a href="http://msdn.microsoft.com/en-us/library/ff431801(v=VS.92).aspx"&gt;MSDN article&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Now let’s see some great PhoneGap apps with App Bars!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10247694" width="1" height="1"&gt;</content><author><name>GlenGordon</name><uri>http://blogs.msdn.com/glengordon/ProfileUrlRedirect.ashx</uri></author><category term="PhoneGap" scheme="http://blogs.msdn.com/b/glengordon/archive/tags/PhoneGap/" /></entry><entry><title>PhoneGap on WP7 Tip #3: Sending SMS and intro to Plugins</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/glengordon/archive/2011/12/02/phonegap-on-wp7-tip-3-sending-sms-and-intro-to-plugins.aspx" /><id>http://blogs.msdn.com/b/glengordon/archive/2011/12/02/phonegap-on-wp7-tip-3-sending-sms-and-intro-to-plugins.aspx</id><published>2011-12-02T18:47:27Z</published><updated>2011-12-02T18:47:27Z</updated><content type="html">&lt;p&gt;In this tip, I’m going to show you how to send an SMS message from PhoneGap on Windows Phone using the &lt;a href="http://msdn.microsoft.com/en-us/library/microsoft.phone.tasks.smscomposetask(v=VS.92).aspx"&gt;SMSCompose&lt;/a&gt; member of the &lt;a href="http://msdn.microsoft.com/en-us/library/microsoft.phone.tasks(v=VS.92).aspx"&gt;Microsoft.Phone.Tasks&lt;/a&gt; namespace. There are a lot of useful launchers and choosers in that namespace, and I’ll be writing about some in detail in a future blog post. I’m also using the SMSCompose task to introduce another way to interoperate between your PhoneGap application and the underlying platform, and that is through a PhoneGap plugin.&lt;/p&gt;  &lt;p&gt;In the previous tip, I showed how you could write some code in the Silverlight application that is hosting the PhoneGap application, and call it from PhoneGap via the scripting interface. Plugins are simply a different mechanism to invoke platform specific code. The technique is pretty well known to PhoneGap developers already, so it makes sense to explore how to use it in Windows Phone.&lt;/p&gt;  &lt;p&gt;PhoneGap has quite a few cross platform APIs in place to handle interop with each platform, in areas such as location, storage, sounds, etc. These are very useful in allowing you to write code that uses those features only once and run it on any device that PhoneGap supports. But, sometimes there are platform specific things you want to take advantage of (and in the case of Windows Phone there are many) so Plugins is a handy way to do that. &lt;a href="http://www.risingj.com/"&gt;Jesse MacFayden&lt;/a&gt; has also written a great blog post to get you started on writing PhoneGap plugins for Windows Phone.&lt;/p&gt;  &lt;p&gt;We’re going to write a plugin to allow us to send an SMS message from JavaScript in PhoneGap using Windows Phone. First, let’s look at the code in C# for sending an SMS message.&lt;/p&gt;  &lt;div id="codeSnippetWrapper"&gt;   &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;     &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;SmsComposeTask smsTask = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; SmsComposeTask();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;smsTask.To = &lt;span style="color: #006080"&gt;&amp;quot;4045551212&amp;quot;&lt;/span&gt;;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;smsTask.Body = &lt;span style="color: #006080"&gt;&amp;quot;Message for you, sir!&amp;quot;&lt;/span&gt;;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;smsTask.Show();&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;Pretty straightforward. Note that in this API, it’s fire-and-forget in that we do not receive a return value. What we’d like to do now is provide a JavaScript function we can call from our PhoneGap application that could invoke that. Maybe we want it to look like this:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;sendSMS.send(‘4045551212’, ’Hello’);&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Let’s connect those two ends. First of all, we need to put the above C# code into a method in a class that can be called by the PhoneGap runtime. These classes can conveniently be placed in the Plugins folder in your PhoneGap project.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-31-52-metablogapi/8176.image_5F00_4.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-31-52-metablogapi/0624.image_5F00_thumb_5F00_1.png" width="423" height="502" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To add the class, right click on the Plugins folder and chose &lt;strong&gt;Add New Item&lt;/strong&gt;. Pick &lt;strong&gt;Class&lt;/strong&gt; and name it whatever you want. I named this one &lt;strong&gt;SendSMS.cs&lt;/strong&gt;. The class has a lot of extra &lt;strong&gt;using&lt;/strong&gt; statements at the top we don’t need, so feel free to remove them for simplicity. &lt;/p&gt;

&lt;p&gt;Next, we need to change the namespace. By default, the namespace is our Visual Studio project. However, we want this class to be part of the PhoneGap runtime library’s namespace, so change the namespace at the top of the code to be &lt;strong&gt;WP7GapClassLib.PhoneGap.Commands&lt;/strong&gt;. We also need to change our class to inherit from the PhoneGap runtime’s BaseCommand class so it has all the plumbing in place to be invoked from our JavaScript. So after the name of the class, put &lt;strong&gt;: BaseCommand&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Then, inside the class, we need a method to hold our SMS Compose code. I created one called &lt;strong&gt;send&lt;/strong&gt; but you can call it whatever you want. Now we can put the code from above in that method. In order to reference the SmsCompose task we need to bring its namespace reference into our class by adding &lt;strong&gt;using Microsoft.Phone.Tasks&lt;/strong&gt; to the top of the class. By now,you should have something that looks like this:&lt;/p&gt;

&lt;div id="codeSnippetWrapper"&gt;
  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;
    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;using&lt;/span&gt; Microsoft.Phone.Tasks;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&amp;#160;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;namespace&lt;/span&gt; WP7GapClassLib.PhoneGap.Commands&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;{&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; SendSMS : BaseCommand&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;        &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; send(&lt;span style="color: #0000ff"&gt;string&lt;/span&gt; args)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;        {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;            SmsComposeTask smsTask = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; SmsComposeTask();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;            smsTask.To = &lt;span style="color: #006080"&gt;&amp;quot;(678) 555-1212”;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;            smsTask.Body = &amp;quot;&lt;/span&gt;Hello&amp;quot;;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;            smsTask.Show();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;        }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;}&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;Although the recipient and message body are hard-coded, let’s leave that for now so we can get it working. &lt;/p&gt;

&lt;p&gt;The next step is to set up a way to invoke this &lt;strong&gt;send&lt;/strong&gt; method from the JavaScript in your PhoneGap application. The way you implement this method is up to you, but most PhoneGap developers will agree that it’s important to provide a consistent way to call Plugins across platforms. To that end, I went out and looked at a &lt;a href="https://github.com/phonegap/phonegap-plugins"&gt;list of PhoneGap plugins developed by the community&lt;/a&gt;, and I found one that &lt;a href="https://github.com/phonegap/phonegap-plugins/tree/master/iPhone/SMSComposer"&gt;handles sending SMS messages on the iPhone&lt;/a&gt;. So I will create a method signature in JavaScript that matches the one for use on iOS. The JavaScript is below (inside of a .js file in your www directory in the project).&lt;/p&gt;

&lt;div id="codeSnippetWrapper"&gt;
  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;
    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;function&lt;/span&gt; SMSComposer(){    &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.resultCallback = &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;}&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&amp;#160;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;SMSComposer.prototype.showSMSComposer = &lt;span style="color: #0000ff"&gt;function&lt;/span&gt;(toRecipients, body)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;{&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;var&lt;/span&gt; args = {};    &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;if&lt;/span&gt;(toRecipients)        &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;        args.toRecipients = toRecipients;    &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;if&lt;/span&gt;(body)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;        args.body = body;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;   &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    PhoneGap.exec(&lt;span style="color: #0000ff"&gt;null&lt;/span&gt;, &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;, &lt;span style="color: #006080"&gt;&amp;quot;SendSMS&amp;quot;&lt;/span&gt;, &lt;span style="color: #006080"&gt;&amp;quot;send&amp;quot;&lt;/span&gt;, args);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&amp;#160;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&amp;#160;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&amp;#160;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;PhoneGap.addConstructor(&lt;span style="color: #0000ff"&gt;function&lt;/span&gt; () {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (!window.plugins) {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;        window.plugins = {};&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    window.plugins.smsComposer = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; SMSComposer();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;   );&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;This is a little different from the iPhone one. Since the SmsComposeTask doesn’t return a result, we don’t need any callbacks in JavaScript. The connection point in here is in the &lt;strong&gt;PhoneGap.exec&lt;/strong&gt; call. The first two parameters (currently null) would be the function names that you’d write to handle a callback and an exception coming out of this method call. The third parameter is the name of the C# class, and the fourth is the C# method name. The fifth parameter is a JavaScript object containing any information we want to send to the function we’re calling. For now remember we are ignoring them in our C# code.&lt;/p&gt;

&lt;p&gt;With the Plugin’s API in place, just reference that .js file in a &amp;lt;script&amp;gt; tag, and write some JavaScript to call &lt;strong&gt;window.plugins.smsComposer.showSMSComposer(recipients, message)&lt;/strong&gt; with one or more recipient and a message. That’s the same JavaScript you’d write to call the iOS version using that plugin on that platform. By the way, this is what the SMS composer screen will look like to your end users, and if you run your project in the emulator, you’ll see the same thing.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-31-52-metablogapi/4846.ss1_5F00_2.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="ss1" border="0" alt="ss1" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-31-52-metablogapi/2287.ss1_5F00_thumb.png" width="235" height="389" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The only thing we have to finish here is to actually make use of the recipient list and message that are sent into the C# function via its &lt;strong&gt;args&lt;/strong&gt; parameter. Since the arguments are coming in as a JSON string, we can use a .NET deserialization library to handle that for us. We create a class that has the data fields that match the JSON object graph (recipients and message) and then deserialize the &lt;strong&gt;args&lt;/strong&gt; parameter into an instance of that class. The deserialization is automatic provided the members of the class match the names and data types of the JSON object graph. Here’s the full version of the C# class with those changes:&lt;/p&gt;

&lt;div id="codeSnippetWrapper"&gt;
  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;
    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;using&lt;/span&gt; Microsoft.Phone.Tasks;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;using&lt;/span&gt; System.Runtime.Serialization;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&amp;#160;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;namespace&lt;/span&gt; WP7GapClassLib.PhoneGap.Commands&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;{&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&amp;#160;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; sendSMSargs&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;        [DataMember]&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;        &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; toRecipients;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&amp;#160;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;        [DataMember]&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;        &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; body;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;     }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; SendSMS : BaseCommand&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;        &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; send(&lt;span style="color: #0000ff"&gt;string&lt;/span&gt; args)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;        {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;            sendSMSargs myargs = JSON.JsonHelper.Deserialize&amp;lt;sendSMSargs&amp;gt;(args);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;            &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;            SmsComposeTask smsTask = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; SmsComposeTask();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;            smsTask.To = myargs.toRecipients;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;            smsTask.Body = myargs.body;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;            smsTask.Show();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;                        &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;            &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.DispatchCommandResult();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;        }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;}&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;If you want to use this plugin in other PhoneGap on Windows Phone 7 projects, you’ll just need the C# class file and the JavaScript that calls &lt;strong&gt;PhoneGap.exec&lt;/strong&gt;. As I mentioned, there are many Windows Phone APIs that can be wrapped in plugins for use in PhoneGap, and I’ll be covering some in future blog posts.&lt;/p&gt;

&lt;p&gt;There are definitely times you’ll want to use plugins and times you’ll want to use the script interface, and I’ll cover those in more detail in a later post as well. Happy coding!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10243794" width="1" height="1"&gt;</content><author><name>GlenGordon</name><uri>http://blogs.msdn.com/glengordon/ProfileUrlRedirect.ashx</uri></author><category term="Windows Phone 7" scheme="http://blogs.msdn.com/b/glengordon/archive/tags/Windows+Phone+7/" /><category term="PhoneGap" scheme="http://blogs.msdn.com/b/glengordon/archive/tags/PhoneGap/" /></entry><entry><title>PhoneGap on WP7 Tip #2: Script interaction</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/glengordon/archive/2011/11/21/phonegap-on-wp7-tip-2-script-interaction.aspx" /><id>http://blogs.msdn.com/b/glengordon/archive/2011/11/21/phonegap-on-wp7-tip-2-script-interaction.aspx</id><published>2011-11-22T03:42:09Z</published><updated>2011-11-22T03:42:09Z</updated><content type="html">&lt;p&gt;(This post is part of my series &lt;a href="http://aka.ms/phonegapwp7"&gt;PhoneGap on Windows Phone 7 tips&lt;/a&gt;.)&lt;/p&gt;  &lt;p&gt;When you are creating integration points between your PhoneGap HTML5 application and the Silverlight hosting application, there are a few ways you can go about crossing the &lt;em&gt;gap&lt;/em&gt; (pun intended). This tip is an example of one of those techniques. It’s very flexible, and is typically going to be used when you have one off types of code being written on both sides. We’re able to do this because the PhoneGap user control actually wraps a Windows Phone WebBrowser control, and we can access that internal WebBrowser and use the &lt;strong&gt;InvokeScript &lt;/strong&gt;method and the &lt;strong&gt;ScriptNotify&lt;/strong&gt; event to do what we want here. If you’re curious as to all the details about the WebBrowser control and if there’s other things you can do in the context of a PhoneGap application, you can &lt;a href="http://msdn.microsoft.com/en-us/library/ff431812(v=VS.92).aspx"&gt;read about it on the MSDN site&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;As a side note, if you try the examples below and your version of &lt;strong&gt;PGView&lt;/strong&gt; does not seem to have a Browser member, you’re probably working with an older version of the PhoneGap user control. To get the latest version, you’ll need to download the framework for the control, build that project, then add output of that to &lt;em&gt;your &lt;/em&gt;project. To do that, open the solution &lt;strong&gt;WP7GapClassLib &lt;/strong&gt;in the &lt;strong&gt;framework &lt;/strong&gt;folder of the &lt;strong&gt;WP7GapBuild &lt;/strong&gt;project. Build that solution. Then, when you create a project from the GapAppStarter template, simply right-click on the &lt;strong&gt;GapLib&lt;/strong&gt; folder, choose Add Existing Item, then browse to the location where the WP7GapClassLib project is stored. Then drill down to the &lt;strong&gt;bin\debug&lt;/strong&gt; folder and pick the &lt;strong&gt;WP7GapClassLib.dll&lt;/strong&gt; file in there. Your references to it should update automatically.&lt;/p&gt;  &lt;p&gt;This script integration technique is bidirectional. You can have the hosting page’s code call into the script in the PhoneGap application, and you can have JavaScript code in the PhoneGap application call code in the hosting Silverlight page.&lt;/p&gt;  &lt;p&gt;Let’s start with a simple button on the Silverlight host page to trigger the code we want to run. On MainPage.xaml, go into designer view, then make room at the bottom of the page for the controls we’re going to add by resizing the PhoneGap control up just a little. Use the grab handle at the bottom of the control, it’s a downward facing triangle. Open the Toolbox at the left side of Visual Studio, if it’s not already open. In there you’ll see a lot of the basic Silverlight controls you can add to a page. Look for the Button control, drag it onto the page below the PhoneGap control. Then set its Content property to “To PhoneGap”. You can use the Property window to the right, or just change it inline in the XAML code. &lt;/p&gt;  &lt;p&gt;To create an event handler, double click the button. That will open a code window and position your cursor inside the newly created button1_Click event handler. Here is where we call the script in PhoneGap. Type in &lt;strong&gt;PGView.Browser.InvokeScript(“button1_Click”); &lt;/strong&gt;Your code window should look like this:&lt;/p&gt;  &lt;div id="codeSnippetWrapper"&gt;   &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: rgb(244, 244, 244);" id="codeSnippet"&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;private&lt;/span&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;void&lt;/span&gt; button1_Click(&lt;span style="color: rgb(0, 0, 255);"&gt;object&lt;/span&gt; sender, RoutedEventArgs e)&lt;br /&gt; {&lt;br /&gt;     PGView.Browser.InvokeScript(&lt;span style="color: rgb(0, 96, 128);"&gt;&amp;quot;button1_Click&amp;quot;&lt;/span&gt;,textBox1.Text.ToString());&lt;br /&gt; }&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Now we need to create a JavaScript function called &lt;strong&gt;button1_Click&lt;/strong&gt; and put our code in it. In the &lt;strong&gt;&amp;lt;script&amp;gt;&lt;/strong&gt; section at the top of &lt;strong&gt;index.html&lt;/strong&gt; in the WWW directory of the project, put in the following script: &lt;/p&gt;

&lt;div id="codeSnippetWrapper"&gt;
  &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: rgb(244, 244, 244);" id="codeSnippet"&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;function&lt;/span&gt; button1_Click() {&lt;br /&gt;           document.getElementById(&lt;span style="color: rgb(0, 96, 128);"&gt;&amp;quot;welcomeMsg&amp;quot;&lt;/span&gt;).innerHTML = &lt;span style="color: rgb(0, 96, 128);"&gt;&amp;quot;You clicked!&amp;quot;&lt;/span&gt;;&lt;br /&gt;       }&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;You could call the function anything you want, but for consistency in the demo I set it up this way. Run the project, click the button, and you should see the HTML change to “You clicked”. &lt;/p&gt;

&lt;p&gt;You can also pass parameters into the script. Go back to the Silverlight page and add a TextBox to the right of the button. Your screen should look a little like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-31-52-metablogapi/7674.image_5F00_35B59D65.png"&gt;&lt;img style="margin: 0px; display: inline; background-image: none;" title="image" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-31-52-metablogapi/8686.image_5F00_thumb_5F00_61F22449.png" width="140" height="244" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Set the Text property of the text box to be an empty value. Change the code in the button click event handler to include sending the Text of the textbox to the script handler.&lt;/p&gt;

&lt;div id="codeSnippetWrapper"&gt;
  &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: rgb(244, 244, 244);" id="codeSnippet"&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;private&lt;/span&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;void&lt;/span&gt; button1_Click(&lt;span style="color: rgb(0, 0, 255);"&gt;object&lt;/span&gt; sender, RoutedEventArgs e)&lt;br /&gt;{&lt;br /&gt;    PGView.Browser.InvokeScript(&lt;span style="color: rgb(0, 96, 128);"&gt;&amp;quot;button1_Click&amp;quot;&lt;/span&gt;,textBox1.Text.ToString());&lt;br /&gt;}&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Then, we need to update the JavaScript &lt;strong&gt;button1_Click&lt;/strong&gt; function to accept the parameter:&lt;/p&gt;

&lt;div id="codeSnippetWrapper"&gt;
  &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: rgb(244, 244, 244);" id="codeSnippet"&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;function&lt;/span&gt; button1_Click(textbox) {&lt;br /&gt;    document.getElementById(&lt;span style="color: rgb(0, 96, 128);"&gt;&amp;quot;welcomeMsg&amp;quot;&lt;/span&gt;).innerHTML = &lt;span style="color: rgb(0, 96, 128);"&gt;&amp;quot;The TextBox says: &amp;quot;&lt;/span&gt; + textbox;&lt;br /&gt;}&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;That parameter could be a collection/array too, if you need it.&lt;/p&gt;

&lt;p&gt;(By the way, as you run this sample and click in the text box to type, you’ll see the emulator’s onscreen keyboard appear. The first thing to notice is that it slides your PhoneGap display up and off the screen. We’ll address that in a later article. Secondly, if you’d like to type with your computer’s keyboard rather than clicking the letters on the screen, just press Pause or Page Up / Page Down to toggle that.)&lt;/p&gt;

&lt;p&gt;Going the other direction is a bit trickier, since you need to tell the host Silverlight page to expect a call “up” from the WebBrowser control inside the PhoneGap control. Add a button to the HTML page like so:&lt;/p&gt;

&lt;div id="codeSnippetWrapper"&gt;
  &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: rgb(244, 244, 244);" id="codeSnippet"&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;button&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;onclick&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;=&amp;quot;window.external.Notify('clearTextBox');&amp;quot;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;&lt;/span&gt;clear textbox&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;button&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Unlike calling &lt;em&gt;into&lt;/em&gt; the PhoneGap’s browser script engine, calling &lt;em&gt;out of&lt;/em&gt; it to the host page always raises a single event – &lt;strong&gt;Browser_ScriptNotify&lt;/strong&gt;. We create an event handler for this in the host page’s constructor method. The constructor is the method with the same name as the host page. In our example it’s &lt;strong&gt;public MainPage()&lt;/strong&gt;. Find that method at the top of the MainPage.xaml.cs file. At the end of that method, type &lt;strong&gt;PGView.Browser.ScriptNotify&lt;/strong&gt; Then type a &lt;strong&gt;space&lt;/strong&gt;, a &lt;strong&gt;plus&lt;/strong&gt;, and an &lt;strong&gt;equals&lt;/strong&gt;. Follow that with two presses on the &lt;strong&gt;Tab&lt;/strong&gt; key. Congratulations, you just learned how to create and wire up an event handler in XAML! That will be a handy set of keystrokes in the future.&lt;/p&gt;

&lt;p&gt;In the newly generated &lt;strong&gt;Browser_ScriptNotify&lt;/strong&gt; method, delete the line that throws a NotImplemented exception, since we’re implementing the function. Look at the method parameters. The second one &lt;strong&gt;e&lt;/strong&gt; is of type NotifyEventArgs. All you really need to know here is that &lt;strong&gt;e.Value&lt;/strong&gt; will contain the string sent from the &lt;strong&gt;window.external.Notify&lt;/strong&gt; call from the PhoneGap control. So let’s write code to handle it.&lt;/p&gt;

&lt;div id="codeSnippetWrapper"&gt;
  &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: rgb(244, 244, 244);" id="codeSnippet"&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;void&lt;/span&gt; Browser_ScriptNotify(&lt;span style="color: rgb(0, 0, 255);"&gt;object&lt;/span&gt; sender, NotifyEventArgs e)&lt;br /&gt;{&lt;br /&gt;    &lt;span style="color: rgb(0, 0, 255);"&gt;string&lt;/span&gt; commandStr = e.Value;&lt;br /&gt;&lt;br /&gt;    &lt;span style="color: rgb(0, 0, 255);"&gt;if&lt;/span&gt; (commandStr == &lt;span style="color: rgb(0, 96, 128);"&gt;&amp;quot;clearTextBox&amp;quot;&lt;/span&gt;)&lt;br /&gt;    {&lt;br /&gt;        textBox1.Text = &lt;span style="color: rgb(0, 96, 128);"&gt;&amp;quot;&amp;quot;&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;    }&lt;br /&gt;}&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Run the project, type some text in the text box, then press the clear textbox button. The text in the textbox should be cleared.&lt;/p&gt;

&lt;p&gt;As you add more places where your JavaScript inside your PhoneGap app needs to talk to the hosting page, you’ll just add new &lt;strong&gt;if&lt;/strong&gt; statements in this event handler. You could get creative and pass an array serialized into json, with perhaps the name of an “action” prepended in front of it in the string.&lt;/p&gt;

&lt;p&gt;Let me know your questions or comments about this technique below!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10239411" width="1" height="1"&gt;</content><author><name>GlenGordon</name><uri>http://blogs.msdn.com/glengordon/ProfileUrlRedirect.ashx</uri></author><category term="Windows Phone 7" scheme="http://blogs.msdn.com/b/glengordon/archive/tags/Windows+Phone+7/" /><category term="PhoneGap" scheme="http://blogs.msdn.com/b/glengordon/archive/tags/PhoneGap/" /></entry><entry><title>PhoneGap on WP7 tip #1: Handling Orientation</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/glengordon/archive/2011/11/16/phonegap-on-wp7-tip-1-handling-orientation.aspx" /><id>http://blogs.msdn.com/b/glengordon/archive/2011/11/16/phonegap-on-wp7-tip-1-handling-orientation.aspx</id><published>2011-11-16T15:08:00Z</published><updated>2011-11-16T15:08:00Z</updated><content type="html">&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Today&amp;rsquo;s PhoneGap on Windows Phone 7 tip involves handling orientation changes. This means when a user rotates their phone from portrait to landscape, the content should rotate as well. Not only that, in some scenarios elements on the screen should reformat for readability and ease of interaction.&lt;/p&gt;
&lt;p&gt;As I mentioned in the &lt;a href="http://blogs.msdn.com/b/glengordon/archive/2011/11/15/phonegap-on-windows-phone-tips.aspx"&gt;introductory post&lt;/a&gt;,, you can do a lot of things within your application just working with HTML/JS/CSS inside the PhoneGap control. But you&amp;rsquo;ll gain a whole new set of app superpowers if you step outside of that. We&amp;rsquo;re starting today with something small &amp;ndash; how to have the PhoneGap part of application rotate properly as the phone changes orientation.&lt;/p&gt;
&lt;p&gt;To get ready for today&amp;rsquo;s tip, let&amp;rsquo;s create a&amp;nbsp;new project in Visual Studio using the PhoneGap template that&amp;rsquo;s described in the &lt;a href="http://blogs.msdn.com/b/glengordon/archive/2011/11/15/phonegap-on-windows-phone-tips.aspx"&gt;introduction to the tip series&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-31-52-metablogapi/1256.image_5F00_6.png"&gt;&lt;img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" title="image" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-31-52-metablogapi/4774.image_5F00_thumb_5F00_2.png" width="604" height="419" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;It&amp;rsquo;s sneaky because you need to click on the &lt;strong&gt;Visual C# &lt;/strong&gt;section on the left pane of the window to display the entire list of templates.&lt;/p&gt;
&lt;p&gt;Once you create the project, what you&amp;rsquo;ll have is essentially a Silverlight for Windows Phone project. PhoneGap is running in a host Silverlight XAML page. By default, Silverlight for Windows Phone applications do not run in landscape mode. You can observe this by running the application (press F5) and click one of the screen rotation buttons on the phone emulator.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-31-52-metablogapi/1050.image_5F00_10.png"&gt;&lt;img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" title="image" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-31-52-metablogapi/1050.image_5F00_thumb_5F00_4.png" width="265" height="373" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;You&amp;rsquo;ll see that the emulator rotates, but the text does not.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-31-52-metablogapi/5270.image_5F00_12.png"&gt;&lt;img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" title="image" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-31-52-metablogapi/8103.image_5F00_thumb_5F00_5.png" width="356" height="187" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;This is a characteristic of the host Silverlight application as well as the HTML rendering inside of the PhoneGap control.&lt;/p&gt;
&lt;p&gt;Allowing the host application to support landscape mode is pretty easy. In Solution Explorer, double click on the MainPage.xaml file. In the Properties window, find the &lt;strong&gt;SupportedOrientations&lt;/strong&gt; and change it to &lt;strong&gt;PortraitOrLandscape&lt;/strong&gt;. Note that you can do this directly in the XAML if you are feeling adventurous. Also note that there is an &lt;strong&gt;Orientation &lt;/strong&gt;property which controls the &lt;em&gt;starting&lt;/em&gt; orientation, so if you want your app to launch in landscape orientation, this is how you would control that.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-31-52-metablogapi/4377.image_5F00_16.png"&gt;&lt;img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" title="image" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-31-52-metablogapi/6837.image_5F00_thumb_5F00_7.png" width="217" height="366" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Run the app again and rotate the emulator.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-31-52-metablogapi/5344.image_5F00_18.png"&gt;&lt;img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" title="image" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-31-52-metablogapi/4375.image_5F00_thumb_5F00_8.png" width="350" height="190" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Success! We now have the host page and the PhoneGap control rotating.&lt;/p&gt;
&lt;p&gt;At this point you could also put JS code in to respond when the devices is rotated, to adjust the UI via swapping out divs or using CSS to control it. Here&amp;rsquo;s a simple example, based on the boilerplate &lt;strong&gt;index.html&lt;/strong&gt; page included in the template.&lt;/p&gt;
&lt;div style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; width: 97.5%; font-family: 'Courier New', courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; cursor: text; border: silver 1px solid; padding: 4px;" id="codeSnippetWrapper"&gt;
&lt;div style="text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;" id="codeSnippet"&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060;" id="lnum1"&gt; 1:&lt;/span&gt; &lt;span style="color: #0000ff;"&gt;&amp;lt;!&lt;/span&gt;&lt;span style="color: #800000;"&gt;DOCTYPE&lt;/span&gt; &lt;span style="color: #ff0000;"&gt;html&lt;/span&gt;&lt;span style="color: #0000ff;"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060;" id="lnum2"&gt; 2:&lt;/span&gt; &lt;span style="color: #0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000;"&gt;html&lt;/span&gt;&lt;span style="color: #0000ff;"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060;" id="lnum3"&gt; 3:&lt;/span&gt;   &lt;span style="color: #0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000;"&gt;head&lt;/span&gt;&lt;span style="color: #0000ff;"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060;" id="lnum4"&gt; 4:&lt;/span&gt;     &lt;span style="color: #0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000;"&gt;meta&lt;/span&gt; &lt;span style="color: #ff0000;"&gt;name&lt;/span&gt;&lt;span style="color: #0000ff;"&gt;="viewport"&lt;/span&gt; &lt;span style="color: #ff0000;"&gt;content&lt;/span&gt;&lt;span style="color: #0000ff;"&gt;="width=device-width, height=device-height, initial-scale=1.0, maximum-scale=1.0, user-scalable=no;"&lt;/span&gt; &lt;span style="color: #0000ff;"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060;" id="lnum5"&gt; 5:&lt;/span&gt;     &lt;span style="color: #0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000;"&gt;meta&lt;/span&gt; &lt;span style="color: #ff0000;"&gt;http-equiv&lt;/span&gt;&lt;span style="color: #0000ff;"&gt;="Content-type"&lt;/span&gt; &lt;span style="color: #ff0000;"&gt;content&lt;/span&gt;&lt;span style="color: #0000ff;"&gt;="text/html; charset=utf-8"&lt;/span&gt;&lt;span style="color: #0000ff;"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060;" id="lnum6"&gt; 6:&lt;/span&gt;     &lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060;" id="lnum7"&gt; 7:&lt;/span&gt;     &lt;span style="color: #0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000;"&gt;title&lt;/span&gt;&lt;span style="color: #0000ff;"&gt;&amp;gt;&lt;/span&gt;PhoneGap WP7&lt;span style="color: #0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000;"&gt;title&lt;/span&gt;&lt;span style="color: #0000ff;"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060;" id="lnum8"&gt; 8:&lt;/span&gt;     &lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060;" id="lnum9"&gt; 9:&lt;/span&gt;       &lt;span style="color: #0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000;"&gt;link&lt;/span&gt; &lt;span style="color: #ff0000;"&gt;rel&lt;/span&gt;&lt;span style="color: #0000ff;"&gt;="stylesheet"&lt;/span&gt; &lt;span style="color: #ff0000;"&gt;href&lt;/span&gt;&lt;span style="color: #0000ff;"&gt;="master.css"&lt;/span&gt; &lt;span style="color: #ff0000;"&gt;type&lt;/span&gt;&lt;span style="color: #0000ff;"&gt;="text/css"&lt;/span&gt; &lt;span style="color: #ff0000;"&gt;media&lt;/span&gt;&lt;span style="color: #0000ff;"&gt;="screen"&lt;/span&gt; &lt;span style="color: #ff0000;"&gt;title&lt;/span&gt;&lt;span style="color: #0000ff;"&gt;="no title"&lt;/span&gt; &lt;span style="color: #ff0000;"&gt;charset&lt;/span&gt;&lt;span style="color: #0000ff;"&gt;="utf-8"&lt;/span&gt;&lt;span style="color: #0000ff;"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060;" id="lnum10"&gt; 10:&lt;/span&gt;       &lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060;" id="lnum11"&gt; 11:&lt;/span&gt;       &lt;span style="color: #0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000;"&gt;script&lt;/span&gt; &lt;span style="color: #ff0000;"&gt;type&lt;/span&gt;&lt;span style="color: #0000ff;"&gt;="text/javascript"&lt;/span&gt;&lt;span style="color: #0000ff;"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060;" id="lnum1"&gt; 1:&lt;/span&gt;  &lt;/pre&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060;" id="lnum2"&gt; 2:&lt;/span&gt;           &lt;span style="color: #008000;"&gt;// provide our own console if it does not exist, huge dev aid!&lt;/span&gt;&lt;/pre&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060;" id="lnum3"&gt; 3:&lt;/span&gt;           &lt;span style="color: #0000ff;"&gt;if&lt;/span&gt;(&lt;span style="color: #0000ff;"&gt;typeof&lt;/span&gt; window.console == &lt;span style="color: #006080;"&gt;"undefined"&lt;/span&gt;)&lt;/pre&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060;" id="lnum4"&gt; 4:&lt;/span&gt;           {&lt;/pre&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060;" id="lnum5"&gt; 5:&lt;/span&gt;           window.console = {log:&lt;span style="color: #0000ff;"&gt;function&lt;/span&gt;(str){window.external.Notify(str);}};&lt;/pre&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060;" id="lnum6"&gt; 6:&lt;/span&gt;           }&lt;/pre&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060;" id="lnum7"&gt; 7:&lt;/span&gt;         &lt;/pre&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060;" id="lnum8"&gt; 8:&lt;/span&gt;           &lt;span style="color: #008000;"&gt;// output any errors to console log, created above.&lt;/span&gt;&lt;/pre&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060;" id="lnum9"&gt; 9:&lt;/span&gt;           window.onerror=&lt;span style="color: #0000ff;"&gt;function&lt;/span&gt;(e)&lt;/pre&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060;" id="lnum10"&gt; 10:&lt;/span&gt;           {&lt;/pre&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060;" id="lnum11"&gt; 11:&lt;/span&gt;               console.log(&lt;span style="color: #006080;"&gt;"window.onerror ::"&lt;/span&gt; + JSON.stringify(e));&lt;/pre&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060;" id="lnum12"&gt; 12:&lt;/span&gt;           };&lt;/pre&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060;" id="lnum13"&gt; 13:&lt;/span&gt;         &lt;/pre&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060;" id="lnum14"&gt; 14:&lt;/span&gt;           console.log(&lt;span style="color: #006080;"&gt;"Installed console ! "&lt;/span&gt;);&lt;/pre&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060;" id="lnum15"&gt; 15:&lt;/span&gt;       &lt;/pre&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;!--CRLF--&gt;&lt;span style="color: #0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000;"&gt;script&lt;/span&gt;&lt;span style="color: #0000ff;"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060;" id="lnum1"&gt; 1:&lt;/span&gt;  &lt;/pre&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060;" id="lnum2"&gt; 2:&lt;/span&gt;       &lt;/pre&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060;" id="lnum3"&gt; 3:&lt;/span&gt;       &amp;lt;script type=&lt;span style="color: #006080;"&gt;"text/javascript"&lt;/span&gt; charset=&lt;span style="color: #006080;"&gt;"utf-8"&lt;/span&gt; src=&lt;span style="color: #006080;"&gt;"phonegap-1.2.0.js"&lt;/span&gt;&amp;gt;&lt;/pre&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060;" id="lnum1"&gt; 1:&lt;/span&gt; &amp;lt;/script&amp;gt;&lt;/pre&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060;" id="lnum2"&gt; 2:&lt;/span&gt;        &lt;/pre&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060;" id="lnum3"&gt; 3:&lt;/span&gt;       &amp;lt;script type=&lt;span style="color: #006080;"&gt;"text/javascript"&lt;/span&gt;&amp;gt;&lt;/pre&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060;" id="lnum4"&gt; 4:&lt;/span&gt;  &lt;/pre&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060;" id="lnum5"&gt; 5:&lt;/span&gt;         document.addEventListener(&lt;span style="color: #006080;"&gt;"deviceready"&lt;/span&gt;,onDeviceReady,&lt;span style="color: #0000ff;"&gt;false&lt;/span&gt;);&lt;/pre&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060;" id="lnum6"&gt; 6:&lt;/span&gt;  &lt;/pre&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060;" id="lnum7"&gt; 7:&lt;/span&gt;         &lt;span style="color: #008000;"&gt;// once the device ready event fires, you can safely do your thing! -jm&lt;/span&gt;&lt;/pre&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060;" id="lnum8"&gt; 8:&lt;/span&gt;         &lt;span style="color: #0000ff;"&gt;function&lt;/span&gt; onDeviceReady()&lt;/pre&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060;" id="lnum9"&gt; 9:&lt;/span&gt;         {&lt;/pre&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060;" id="lnum10"&gt; 10:&lt;/span&gt;             document.getElementById(&lt;span style="color: #006080;"&gt;"welcomeMsg"&lt;/span&gt;).innerHTML += &lt;span style="color: #006080;"&gt;"PhoneGap is ready! version="&lt;/span&gt; + window.device.phonegap;&lt;/pre&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060;" id="lnum11"&gt; 11:&lt;/span&gt;             window.addEventListener(&lt;span style="color: #006080;"&gt;"orientationchange"&lt;/span&gt;, orientationChange, &lt;span style="color: #0000ff;"&gt;true&lt;/span&gt;);&lt;/pre&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060;" id="lnum12"&gt; 12:&lt;/span&gt;             &lt;/pre&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060;" id="lnum13"&gt; 13:&lt;/span&gt;         }&lt;/pre&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060;" id="lnum14"&gt; 14:&lt;/span&gt;         &lt;span style="color: #0000ff;"&gt;function&lt;/span&gt; orientationChange(e) {&lt;/pre&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060;" id="lnum15"&gt; 15:&lt;/span&gt;             &lt;span style="color: #0000ff;"&gt;var&lt;/span&gt; orientation = &lt;span style="color: #006080;"&gt;"portrait"&lt;/span&gt;;&lt;/pre&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060;" id="lnum16"&gt; 16:&lt;/span&gt;             &lt;span style="color: #0000ff;"&gt;if&lt;/span&gt; (window.orientation == -90 || window.orientation == 90) orientation = &lt;span style="color: #006080;"&gt;"landscape"&lt;/span&gt;;&lt;/pre&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060;" id="lnum17"&gt; 17:&lt;/span&gt;             document.getElementById(&lt;span style="color: #006080;"&gt;"orientation"&lt;/span&gt;).innerHTML = orientation;&lt;/pre&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060;" id="lnum18"&gt; 18:&lt;/span&gt;         }&lt;/pre&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060;" id="lnum19"&gt; 19:&lt;/span&gt;       &lt;/pre&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;!--CRLF--&gt;&lt;span style="color: #0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000;"&gt;script&lt;/span&gt;&lt;span style="color: #0000ff;"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060;" id="lnum12"&gt; 12:&lt;/span&gt;       &lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060;" id="lnum13"&gt; 13:&lt;/span&gt;      &lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060;" id="lnum14"&gt; 14:&lt;/span&gt;       &lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060;" id="lnum15"&gt; 15:&lt;/span&gt;  &lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060;" id="lnum16"&gt; 16:&lt;/span&gt;   &lt;span style="color: #0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000;"&gt;head&lt;/span&gt;&lt;span style="color: #0000ff;"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060;" id="lnum17"&gt; 17:&lt;/span&gt;   &lt;span style="color: #0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000;"&gt;body&lt;/span&gt;&lt;span style="color: #0000ff;"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060;" id="lnum18"&gt; 18:&lt;/span&gt;     &lt;span style="color: #0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000;"&gt;h1&lt;/span&gt;&lt;span style="color: #0000ff;"&gt;&amp;gt;&lt;/span&gt;Hello PhoneGap&lt;span style="color: #0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000;"&gt;h1&lt;/span&gt;&lt;span style="color: #0000ff;"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060;" id="lnum19"&gt; 19:&lt;/span&gt;     &lt;span style="color: #0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000;"&gt;div&lt;/span&gt; &lt;span style="color: #ff0000;"&gt;id&lt;/span&gt;&lt;span style="color: #0000ff;"&gt;="welcomeMsg"&lt;/span&gt;&lt;span style="color: #0000ff;"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000;"&gt;div&lt;/span&gt;&lt;span style="color: #0000ff;"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060;" id="lnum20"&gt; 20:&lt;/span&gt;     &lt;span style="color: #0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000;"&gt;div&lt;/span&gt; &lt;span style="color: #ff0000;"&gt;id&lt;/span&gt;&lt;span style="color: #0000ff;"&gt;="orientation"&lt;/span&gt;&lt;span style="color: #0000ff;"&gt;&amp;gt;&lt;/span&gt;portrait&lt;span style="color: #0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000;"&gt;div&lt;/span&gt;&lt;span style="color: #0000ff;"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060;" id="lnum21"&gt; 21:&lt;/span&gt;   &lt;span style="color: #0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000;"&gt;body&lt;/span&gt;&lt;span style="color: #0000ff;"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060;" id="lnum22"&gt; 22:&lt;/span&gt; &lt;span style="color: #0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000;"&gt;html&lt;/span&gt;&lt;span style="color: #0000ff;"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Note the new DIV to hold the text identifying the current orientation state, and the &lt;strong&gt;orientationChange&lt;/strong&gt; function wired up to the event in the &lt;strong&gt;onDeviceReady&lt;/strong&gt; function. It&amp;rsquo;s the host page rotation that causes this event to fire inside the PhoneGap user control. Without the property to allow both orientations, this event would never fire.&lt;/p&gt;
&lt;p&gt;If you want to handle the orientation changed &lt;em&gt;outside&lt;/em&gt; the PhoneGap part of your app, you can wire up a C# event handler at the page level as well. To do this, return to the properties windows for &lt;strong&gt;MainPage.xaml&lt;/strong&gt; and switch to Events at the top of the window. Find the &lt;strong&gt;OrientationChanged&lt;/strong&gt; event. We&amp;rsquo;ll create an event handler by double clicking on the event name.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-31-52-metablogapi/4606.image_5F00_20.png"&gt;&lt;img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" title="image" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-31-52-metablogapi/4375.image_5F00_thumb_5F00_9.png" width="231" height="387" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The MainPage.xaml.cs window will open, ready for us to type in our code.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-31-52-metablogapi/3716.image_5F00_22.png"&gt;&lt;img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" title="image" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-31-52-metablogapi/2543.image_5F00_thumb_5F00_10.png" width="492" height="329" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Allowing the user to work with the application in both portrait and landscape layout makes it more flexible. In later articles I will cover how there are even aspects of Windows Phone development that respond automatically to the orientation changing.&lt;/p&gt;
&lt;p&gt;Let me know your feedback in the comments, and look for many more PhoneGap on Windows Phone tips coming in subsequent weeks, in increasing levels of complexity. :)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10237730" width="1" height="1"&gt;</content><author><name>GlenGordon</name><uri>http://blogs.msdn.com/glengordon/ProfileUrlRedirect.ashx</uri></author><category term="Windows Phone 7" scheme="http://blogs.msdn.com/b/glengordon/archive/tags/Windows+Phone+7/" /><category term="PhoneGap" scheme="http://blogs.msdn.com/b/glengordon/archive/tags/PhoneGap/" /></entry><entry><title>PhoneGap on Windows Phone Tips</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/glengordon/archive/2011/11/15/phonegap-on-windows-phone-tips.aspx" /><id>http://blogs.msdn.com/b/glengordon/archive/2011/11/15/phonegap-on-windows-phone-tips.aspx</id><published>2011-11-16T01:04:00Z</published><updated>2011-11-16T01:04:00Z</updated><content type="html">&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;A few months ago, Microsoft a&lt;a href="http://windowsteamblog.com/windows_phone/b/wpdev/archive/2011/09/08/phonegap-mobile-html5-framework-adding-support-for-windows-phone-mango.aspx"&gt;nnounced support for PhoneGap&lt;/a&gt; on Windows Phone Mango. This announcement seems to have flown under the radar, because it hits a (currently) small intersection, developers who know HTML5 and developers who want to target Windows Phone 7. However, the former subset is huge, and the latter is &lt;a href="http://www.windowsphonemetro.com/2011/11/14/windows-phone-sees-large-gains-among-potential-app-developers"&gt;growing rapidly&lt;/a&gt;, so it makes sense to take a look at PhoneGap on WP7.&lt;/p&gt;
&lt;p&gt;From the PhoneGap website, here&amp;rsquo;s a summary of what it is:&lt;/p&gt;
&lt;p&gt;&lt;em&gt;PhoneGap is an HTML5 app platform that allows you to author native applications with web technologies and get access to APIs and app stores. PhoneGap leverages web technologies developers already know best... HTML and JavaScript.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;WP7 support for PhoneGap is in fact pretty significant because it opens up the Windows Phone Marketplace to tons of developers who have HTML/JS skills. Turns out you can create some pretty nifty apps with only those technologies running inside a Windows Phone app. But what if you want to take it up a level and really incorporate some cool features of the phone? Well, allow me to fill that&amp;hellip; gap. &amp;lt;grin&amp;gt;&lt;/p&gt;
&lt;p&gt;Over the next few months, I will be sharing tips about how to make PhoneGap applications on Windows Phone feel like first class citizens there. I&amp;rsquo;m not going to cover how to write HTML/JS applications within it, because there are tons of examples on the web as to how to do that. Also, PhoneGap provides its own API for using specific capabilities of the the underlying platform that is common across all devices, so we won&amp;rsquo;t be covering that here either.&lt;/p&gt;
&lt;p&gt;Instead, this series will be tips on how to use Windows Phone specific features in your PhoneGap apps. Having your PhoneGap application support some of Windows Phone&amp;rsquo;s most compelling features like Live Tiles, background agents, push notifications and the application bar means users will get the engaging experience they expect from WP7 apps along with the functionality you deliver via HTML/JS from the main UI of your app. And most if not all of these features can be implemented with zero impact to your common code base, so a lot of your cross platform code can be preserved.&lt;/p&gt;
&lt;p&gt;Recently, PhoneGap has been accepted into the Apache Software Foundation for incubation as Apache Callback. You can read about the requirements, how to get started, and download the latest bits from &lt;a href="https://github.com/callback/callback-windows-phone"&gt;here&lt;/a&gt;. The most significant aspect of the bits you need right now is the GapAppStarter.zip template file.&lt;/p&gt;
&lt;p&gt;PhoneGap on Windows Phone 7 Article Index&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="http://blogs.msdn.com/b/glengordon/archive/2011/11/16/phonegap-on-wp7-tip-1-handling-orientation.aspx"&gt;Tip #1: Handling Orientation Changes&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://blogs.msdn.com/b/glengordon/archive/2011/11/21/phonegap-on-wp7-tip-2-script-interaction.aspx"&gt;Tip #2: Script Interaction&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://blogs.msdn.com/b/glengordon/archive/2011/12/02/phonegap-on-wp7-tip-3-sending-sms-and-intro-to-plugins.aspx"&gt;Tip #3: Sending SMS and intro to Plugins&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://blogs.msdn.com/b/glengordon/archive/2011/12/14/phonegap-on-wp7-tip-4-the-application-bar.aspx"&gt;Tip #4: The Application Bar&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=10237536" width="1" height="1"&gt;</content><author><name>GlenGordon</name><uri>http://blogs.msdn.com/glengordon/ProfileUrlRedirect.ashx</uri></author><category term="Windows Phone 7" scheme="http://blogs.msdn.com/b/glengordon/archive/tags/Windows+Phone+7/" /><category term="PhoneGap" scheme="http://blogs.msdn.com/b/glengordon/archive/tags/PhoneGap/" /></entry><entry><title>Resources for my “What’s New in Mango” talk</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/glengordon/archive/2011/11/14/resources-for-my-what-s-new-in-mango-talk.aspx" /><id>http://blogs.msdn.com/b/glengordon/archive/2011/11/14/resources-for-my-what-s-new-in-mango-talk.aspx</id><published>2011-11-14T14:40:34Z</published><updated>2011-11-14T14:40:34Z</updated><content type="html">&lt;p&gt;Thanks to all who came out to last week’s Atlanta .NET user group meeting. Although we were moved a week back due to Halloween, I'll pretend it was some kind of super Daylight Saving time adjustment instead. (grin&amp;gt;. In any case, here are resources for the talk I did on new developer features in Windows Phone Mango. The slide deck is below, followed by links to more information. Enjoy!&lt;/p&gt;  &lt;div style="width: 425px" id="__ss_10154439"&gt;&lt;strong style="margin: 12px 0px 4px; display: block"&gt;&lt;a title="What&amp;#39;s new in Windows Phone Mango for Developers" href="http://www.slideshare.net/glengordon/whats-new-in-windows-phone-mango-for-developers" target="_blank"&gt;What's new in Windows Phone Mango for Developers&lt;/a&gt;&lt;/strong&gt; &lt;iframe height="355" marginheight="0" src="http://www.slideshare.net/slideshow/embed_code/10154439" frameborder="0" width="425" marginwidth="0" scrolling="no"&gt;&lt;/iframe&gt;&lt;/div&gt;  &lt;p&gt;Fast Application Switching – make sure you are coding the proper behavior into your apps so they don’t do a full restore from session state if it had only been suspended and not tombstoned – you’ll get much better performance. Here’s a quick lab on &lt;a title="http://msdn.microsoft.com/en-us/hh220575" href="http://msdn.microsoft.com/en-us/hh220575"&gt;how to do it&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;Speaking of suspended applications, I showed that now on Mango you can write some code to run periodically in the form of a background agent. Just remember that it’s not really your main app running in the background, but just a small bit of code that does some particular task when the OS wakes the agent, either every 30 minutes or so, or when the phone is on external power and WiFi. Read the &lt;a title="http://msdn.microsoft.com/en-us/library/hh202942%28v=VS.92%29.aspx" href="http://msdn.microsoft.com/en-us/library/hh202942%28v=VS.92%29.aspx"&gt;overview of Background Agents&lt;/a&gt; to get started. If you want to download/upload files there’s an easy, monitorable way to do that with &lt;a title="http://msdn.microsoft.com/en-us/library/hh202953(v=VS.92).aspx" href="http://msdn.microsoft.com/en-us/library/hh202953(v=VS.92).aspx"&gt;background file transfers&lt;/a&gt;. And you can notify users with &lt;a href="http://msdn.microsoft.com/en-us/library/hh487170(v=VS.92).aspx"&gt;toast&lt;/a&gt; as well as &lt;a href="http://msdn.microsoft.com/en-us/library/hh202946(v=vs.92).aspx"&gt;alarms/reminders&lt;/a&gt;. Lastly there is the ability to not only play background music while your app is not running, but give users track/artist information and the ability to skip forward and backwards in a playlist via &lt;a href="http://msdn.microsoft.com/en-us/library/hh394039(v=VS.92).aspx"&gt;Background Audio&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;I also showed the basics of updating your application’s tiles. Live Tiles, and the ability to have multiple tiles on the user’s start screen, each representing specific information to the user and each being an entry point for a deep link into your application, is one of the fundamental principles of a compelling Windows Phone application. Don’t take my word for it, Live Tiles are so compelling that we &lt;a href="http://windowsteamblog.com/windows_phone/b/windowsphone/archive/2011/11/07/recap-big-windows-phone-wows-new-york-city.aspx"&gt;built a 6 story Windows Phone in NYC&lt;/a&gt; to show them off. Get started on working with Live Tiles from your application with &lt;a href="http://msdn.microsoft.com/en-us/library/hh202960(v=VS.92).aspx"&gt;this MSDN article&lt;/a&gt;. &lt;/p&gt;  &lt;p&gt;The last thing I showed was Silverlight and XNA integration. At first blush it’s easy to dismiss the significance of this capability. But ask anyone who’s ever tried to implement even the simplest menu or options screen in their XNA game, or who wanted to incorporate 3D model viewing in their Silverlight app, and you’ll see what I mean. Here’s a good &lt;a href="http://www.silverlightshow.net/items/XNA-for-Silverlight-developers-Part-12-Mango-1.aspx"&gt;walkthrough&lt;/a&gt; of the integration points, and here’s a &lt;a href="http://www.youtube.com/watch?v=9LsaQcCAdEU"&gt;video of the British Airways sample&lt;/a&gt; I showed illustrating the use of 3D models in a Silverlight application, complete with the Application Bar on top of the mode.&lt;/p&gt;  &lt;p&gt;So enjoy these refreshing Mango features and let me know if you’ve published apps to the marketplace that take advantage of them!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10236808" width="1" height="1"&gt;</content><author><name>GlenGordon</name><uri>http://blogs.msdn.com/glengordon/ProfileUrlRedirect.ashx</uri></author><category term="Windows Phone 7" scheme="http://blogs.msdn.com/b/glengordon/archive/tags/Windows+Phone+7/" /></entry><entry><title>WebVisions Mobile Hackathon for Good in ATL November 17</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/glengordon/archive/2011/11/09/webvisions-mobile-hackathon-for-good-in-atl-november-17.aspx" /><id>http://blogs.msdn.com/b/glengordon/archive/2011/11/09/webvisions-mobile-hackathon-for-good-in-atl-november-17.aspx</id><published>2011-11-09T20:03:24Z</published><updated>2011-11-09T20:03:24Z</updated><content type="html">&lt;p&gt;Yet another great sounding conference is headed to Atlanta. This one is WebVisions and it explores the future of the Web and mobile design, technology, user experience and business strategy. After 11 years in Portland, the show is bringing its Indie/DIY/Maker vibe to Atlanta with presentations, studio tours and more. Unlike other conferences, WebVisions' all-star lineup of visionary speakers stake out the future of web and mobile, while offering practical tips that can be incorporated into today's projects. &lt;/p&gt;  &lt;p&gt;I want to specifically call out a great event that is part of WebVisions and that is the &lt;strong&gt;Mobile Hackathon for Good&lt;/strong&gt;. This is an opportunity to learn about Windows Phone app development and design, then use those skills to help out a good cause to boot! The free hackathon offers 1/2 day of instruction from several local WP7 experts, followed by an afternoon of building applications for great local organizations like Hands On Atlanta and other non-profits to help them advance their causes. At the end of the hackathon there will be reviews of the apps and prizes to be won.&lt;/p&gt;  &lt;p&gt;Sign up today to participate in the hackathon, and you can even get a discounted day 2 ticket for WebVisions! Sign up at &lt;a title="http://www.webvisionsevent.com/atlanta/session/mobile-hackathon/" href="http://www.webvisionsevent.com/atlanta/session/mobile-hackathon/"&gt;http://www.webvisionsevent.com/atlanta/session/mobile-hackathon/&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10235486" width="1" height="1"&gt;</content><author><name>GlenGordon</name><uri>http://blogs.msdn.com/glengordon/ProfileUrlRedirect.ashx</uri></author></entry><entry><title>Community Phone Camp in Birmingham, AL November 9</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/glengordon/archive/2011/10/21/community-phone-camp-in-birmingham-al-november-9.aspx" /><id>http://blogs.msdn.com/b/glengordon/archive/2011/10/21/community-phone-camp-in-birmingham-al-november-9.aspx</id><published>2011-10-21T14:50:09Z</published><updated>2011-10-21T14:50:09Z</updated><content type="html">&lt;p&gt;&lt;img src="http://farm6.static.flickr.com/5302/5791416126_cab6f68880.jpg" /&gt;&lt;/p&gt;  &lt;p&gt;In addition to the Microsoft led &lt;a href="http://blogs.msdn.com/b/devfish/archive/2011/08/31/windows-phonecamps-east-coast-2011.aspx"&gt;Windows Phone camps&lt;/a&gt; that are happening on the east coast, some industrious folks in Birmingham have put together one for folks in Alabama to get up to speed on Windows Phone development, learn about the Mango release, and write some apps!&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.eventbrite.com/event/2340522566"&gt;Register now&lt;/a&gt; for this free event taking place Wednesday, November 9. We’ll be giving away prizes (including a Windows Phone device) for the top apps, and we also have tons of promotions and specials for attendees.&lt;/p&gt;  &lt;p&gt;Do you know iPhone and Android development? Bring your apps and we’ll help you port them!&lt;/p&gt;  &lt;p&gt;The guys in Mobile, AL are working on putting together a community Phone Camp too, once that’s set up we’ll let you know the details.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10228665" width="1" height="1"&gt;</content><author><name>GlenGordon</name><uri>http://blogs.msdn.com/glengordon/ProfileUrlRedirect.ashx</uri></author><category term="Windows Phone 7" scheme="http://blogs.msdn.com/b/glengordon/archive/tags/Windows+Phone+7/" /></entry><entry><title>A Web Afternoon–in Atlanta</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/glengordon/archive/2011/10/18/a-web-afternoon-in-atlanta.aspx" /><id>http://blogs.msdn.com/b/glengordon/archive/2011/10/18/a-web-afternoon-in-atlanta.aspx</id><published>2011-10-18T19:45:26Z</published><updated>2011-10-18T19:45:26Z</updated><content type="html">&lt;p&gt;&lt;strong&gt;A Web Afternoon&lt;/strong&gt; is a mini event intended to inspire and educate people who love the web. It’s being put on by the leaders of the Atlanta Web Design Group.&lt;/p&gt;  &lt;p&gt;Think TED, but for the web. Both speakers and attendees will be people from a variety of disciplines, but who all share a common passion for making the web a better place.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;A Web Afternoon&lt;/strong&gt; will take place on Saturday, October 22, at the GTRI Conference Center in Atlanta.&lt;/p&gt;  &lt;p&gt;&lt;em&gt;&lt;a href="http://webafternoon.com/"&gt;&lt;strong&gt;Learn more and get your tickets here.&lt;/strong&gt;&lt;/a&gt;&lt;strong&gt; &lt;/strong&gt;Bonus: Even though tickets are now $50, just use the code 'amigos' when you checkout to get $15 off.&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;SPEAKERS&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;You come to events like this to learn new things, and our lineup of insightful, engaging people will leave you educated and inspired.&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;strong&gt;Faruk Ates&lt;/strong&gt; :: Co-creator of Modernizer and former Apple UI designer &lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Denise Jacobs&lt;/strong&gt; :: Author of the CSS Detective Guide, co-author of InterAct with Web Standards &lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Ben Friedman&lt;/strong&gt; :: A partner at Iconologic and former AIGA Atlanta President &lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Leslie Jensen-Inman&lt;/strong&gt; :: Co-creator of Make Awesomeness, creative director of InterAct with Web Standards &lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Theo Rosendorf&lt;/strong&gt; :: Author of the Typography Desk Reference and Creative Director at Matador. &lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Michael Mogill&lt;/strong&gt; :: Founder of ATL Nightlife and Reboot Music, VP of FIT Radio. &lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Todd Schnick&lt;/strong&gt; :: Marketing strategist, radio show host, and editor of the 40in240 Mini-MBA project. &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;strong&gt;FREEBIES&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Everyone loves free stuff. At A Web Afternoon you’ll bathe in free WiFi and park your car for free. Plus they’ll be giving away a copy of Adobe Creative Suite Web Premium CS5.5 to one lucky attendee.&lt;/p&gt;  &lt;p&gt;And since they know you’re thirsty, Coffee, soda, water, and other refreshments from Octane Coffee will be available at all times during the event.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;AN AFTER-PARTY, TOO!&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Of course it wouldn't be a good web event without an after-party. We've sequestered a great view of the Atlanta skyline at Rooftop 866 in the Renaissance Midtown. You can join for drinks and conversation, but you'll need your Web Afternoon ticket to do so. :)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10227113" width="1" height="1"&gt;</content><author><name>GlenGordon</name><uri>http://blogs.msdn.com/glengordon/ProfileUrlRedirect.ashx</uri></author></entry><entry><title>Trial mode tips for Windows Phone apps</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/glengordon/archive/2011/10/18/trial-mode-tips-for-windows-phone-apps.aspx" /><id>http://blogs.msdn.com/b/glengordon/archive/2011/10/18/trial-mode-tips-for-windows-phone-apps.aspx</id><published>2011-10-18T18:42:33Z</published><updated>2011-10-18T18:42:33Z</updated><content type="html">&lt;p&gt;At the Windows Phone camps that I’ve been presenting at around the east region, I’ve been showing how to use trial mode to help increase sales by giving users a way to try your application before they commit to buying it. Here are some suggestions to use trial mode effectively.&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Read about &lt;a href="http://msdn.microsoft.com/en-us/library/ff967558(v=VS.92).aspx"&gt;Using the Trial Mode API&lt;/a&gt; there are a lot of good tips in there.&lt;/li&gt;    &lt;li&gt;Check the trial mode when the application starts up as well as when it is activated, since users might be coming back from the activity of actually &lt;em&gt;buying&lt;/em&gt; it in the marketplace, and you want to recognize that without forcing a restart. At the very least, if a restart is required, tell them that when they return to the app.&lt;/li&gt;    &lt;li&gt;Don’t check the trial mode bit from inside an XNA game loop – unless you want to kill the game’s performance and your potential sales. &lt;img style="border-bottom-style: none; border-left-style: none; border-top-style: none; border-right-style: none" class="wlEmoticon wlEmoticon-smile" alt="Smile" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-31-52-metablogapi/7318.wlEmoticon_2D00_smile_5F00_2.png" /&gt;&lt;/li&gt;    &lt;li&gt;Nag trial users appropriately to buy the app, and give them an effortless &lt;a href="http://msdn.microsoft.com/en-us/library/hh394017(v=VS.92).aspx"&gt;way to get into the marketplace to buy it&lt;/a&gt;. Nag them every 3rd or 4th time they run the app, or whenever they run into the limitation of your trial functionality. &lt;/li&gt;    &lt;li&gt;If you have a Silverlight ad control that displays ads in trial mode but not in purchased mode, remember to &lt;a href="http://stackoverflow.com/questions/6119069/wp7-silverlight-how-to-disable-remove-adctrol-from-visual-tree"&gt;remove it from the control hierarchy&lt;/a&gt; – setting its Visibility property to Collapsed doesn’t stop the code from running and the app from making network calls. &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;If you have any tips or questions on trial mode and Windows Phone, or experience using it, share with me and others in the comments.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10227079" width="1" height="1"&gt;</content><author><name>GlenGordon</name><uri>http://blogs.msdn.com/glengordon/ProfileUrlRedirect.ashx</uri></author><category term="Windows Phone 7" scheme="http://blogs.msdn.com/b/glengordon/archive/tags/Windows+Phone+7/" /></entry><entry><title>Go Mango and Win</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/glengordon/archive/2011/10/18/go-mango-and-win.aspx" /><id>http://blogs.msdn.com/b/glengordon/archive/2011/10/18/go-mango-and-win.aspx</id><published>2011-10-18T17:48:30Z</published><updated>2011-10-18T17:48:30Z</updated><content type="html">&lt;p&gt;&lt;img src="http://sharepoint/sites/DPEUSBMOMktgAudience/Go%20Mango%20Apportunity%20Assets/WebGraphic_728x90.jpg" /&gt;&lt;/p&gt;  &lt;p&gt;Here’s a great contest for those of you thinking about publishing Windows Phone applications that take advantage of the new Mango features.&lt;/p&gt;  &lt;p&gt;For every new Mango app you publish, you’ll receive 1 entry into a raffle for a Samsung Series 7 slate PC.&lt;/p&gt;  &lt;p&gt;Publish 5 new apps, and you’ll earn an entry towards winning free advertising for one app of your choice.&amp;#160; The free advertising will run on the Windows Phone Application Network for about 60 days and include 25K impressions. &lt;/p&gt;  &lt;p&gt;For complete rules and to enter, visit &lt;a href="http://bit.ly/MangoOffer"&gt;http://bit.ly/MangoOffer&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10227054" width="1" height="1"&gt;</content><author><name>GlenGordon</name><uri>http://blogs.msdn.com/glengordon/ProfileUrlRedirect.ashx</uri></author></entry><entry><title>Announcing ReMIX South–the top UX/Web/Mobile community conference in the southeast</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/glengordon/archive/2011/07/20/announcing-remix-south-the-top-ux-web-mobile-community-conference-in-the-southeast.aspx" /><id>http://blogs.msdn.com/b/glengordon/archive/2011/07/20/announcing-remix-south-the-top-ux-web-mobile-community-conference-in-the-southeast.aspx</id><published>2011-07-20T23:13:04Z</published><updated>2011-07-20T23:13:04Z</updated><content type="html">&lt;p&gt;As many of you are aware, Microsoft has been holding conferences known as &lt;a href="http://live.visitmix.com/"&gt;MIX&lt;/a&gt; in Vegas for several years. MIX features sessions and speakers from the cutting edge of the design and development world. The local community in Atlanta has channeled the excitement and great learnings from MIX into the premiere event in the southeast, called &lt;a href="http://www.remixsouth.com/"&gt;ReMIX South&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;To me, MIX is a perfect name for this conference, because it really allows for designers, developers, UX specialists, and even enthusiasts to blend together at the same event, even if they are from different technology circles. There will be plenty of things to do at ReMIX, so even if you are coming from out of town, prepare to be thrown into the mix with the local community, your peers, and industry experts.&lt;/p&gt;  &lt;p&gt;Here’s why I think ReMIX South will be a fantastic event:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Tracks on User Experience, Web, Mobile/Tablet and even Kinect. The &lt;a href="http://www.remixsouth.com/#Speakers"&gt;speaker lineup&lt;/a&gt; is stellar, especially the keynoter &lt;a href="http://www.networkworld.com/news/2010/030310-windows-phone-shum.html"&gt;Albert Shum&lt;/a&gt;.&lt;/li&gt;    &lt;li&gt;Networking opportunities with fellow attendees.&lt;/li&gt;    &lt;li&gt;A Windows Phone App Clinic where you can get free advice on development, design, marketing, and more for your in-development Windows Phone app, plus a contest where you can win a free phone.&lt;/li&gt;    &lt;li&gt;A bargain at only $30 (through July 28).&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;You won’t want to miss this event!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10188372" width="1" height="1"&gt;</content><author><name>GlenGordon</name><uri>http://blogs.msdn.com/glengordon/ProfileUrlRedirect.ashx</uri></author></entry><entry><title>Free Microsoft WebCamp coming to Atlanta on August 4</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/glengordon/archive/2011/07/15/free-microsoft-webcamp-coming-to-atlanta-on-august-4.aspx" /><id>http://blogs.msdn.com/b/glengordon/archive/2011/07/15/free-microsoft-webcamp-coming-to-atlanta-on-august-4.aspx</id><published>2011-07-15T19:48:26Z</published><updated>2011-07-15T19:48:26Z</updated><content type="html">&lt;p&gt;The Microsoft &lt;a href="http://www.beautyoftheweb.com/#/camps"&gt;HTML5 Web Camps&lt;/a&gt; are free, full-day events to help you get up to speed with HTML5 and related web standards. &lt;/p&gt;  &lt;p&gt;Over the course of four sessions, you’ll learn about the next wave of web standards including &lt;strong&gt;HTML5&lt;/strong&gt;, &lt;strong&gt;CSS3&lt;/strong&gt;, &lt;strong&gt;ECMAScript5&lt;/strong&gt;, &lt;strong&gt;SVG&lt;/strong&gt;, and more:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;HTML5      &lt;ul&gt;       &lt;li&gt;Semantic Markup, Audio, Video, Canvas, Geolocation, and more &lt;/li&gt;     &lt;/ul&gt;   &lt;/li&gt;    &lt;li&gt;Cascading Style Sheets, Level 3 (CSS3) &lt;/li&gt;    &lt;li&gt;Scalable Vector Graphics (SVG) &lt;/li&gt;    &lt;li&gt;ECMAScript5 and scripting techniques &lt;/li&gt;    &lt;li&gt;Internet Explorer 9      &lt;ul&gt;       &lt;li&gt;Standards support and testing &lt;/li&gt;        &lt;li&gt;Performance &lt;/li&gt;     &lt;/ul&gt;   &lt;/li&gt;    &lt;li&gt;Present and future of web standards      &lt;ul&gt;       &lt;li&gt;Internet Explorer 10 &lt;/li&gt;        &lt;li&gt;Emerging standards (e.g. WebSockets, IndexedDB, etc.) &lt;/li&gt;     &lt;/ul&gt;   &lt;/li&gt;    &lt;li&gt;Developer options and tools      &lt;ul&gt;       &lt;li&gt;Libraries &lt;/li&gt;        &lt;li&gt;IE9 Developer Tools &lt;/li&gt;        &lt;li&gt;Visual Studio 2010 and Expression Web 4 &lt;/li&gt;     &lt;/ul&gt;   &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;You’ll also see techniques and frameworks to help you get started today while still offering good experiences for non-modern browsers.&lt;/p&gt;  &lt;p&gt;&lt;a href="https://msevents.microsoft.com/CUI/EventDetail.aspx?EventID=1032490129&amp;amp;Culture=en-US"&gt;Register now&lt;/a&gt; for this free event in Atlanta on August 4, seats are filling up fast!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10187026" width="1" height="1"&gt;</content><author><name>GlenGordon</name><uri>http://blogs.msdn.com/glengordon/ProfileUrlRedirect.ashx</uri></author></entry><entry><title>Students – build a Windows Phone app this summer and win!</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/glengordon/archive/2011/07/11/students-build-a-windows-phone-app-this-summer-and-win.aspx" /><id>http://blogs.msdn.com/b/glengordon/archive/2011/07/11/students-build-a-windows-phone-app-this-summer-and-win.aspx</id><published>2011-07-11T15:03:52Z</published><updated>2011-07-11T15:03:52Z</updated><content type="html">&lt;p&gt;Are you a college student out of ideas on how to spend your summer? Learn how to build a Windows Phone app (the &lt;a href="http://create.msdn.com/en-US/"&gt;tools are all free&lt;/a&gt;), publish it in the marketplace, and win prizes!&lt;/p&gt;  &lt;p&gt;For full details check out &lt;a title="http://www.wpstudentapp.com/" href="http://www.wpstudentapp.com/"&gt;http://www.wpstudentapp.com/&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.wpstudentapp.com/"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="clip_image001" border="0" alt="clip_image001" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-31-52-metablogapi/6471.clip_5F00_image001_5F00_b71de231_2D00_3dba_2D00_4cf9_2D00_be7b_2D00_1ebeb59e6035.jpg" width="605" height="340" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10185205" width="1" height="1"&gt;</content><author><name>GlenGordon</name><uri>http://blogs.msdn.com/glengordon/ProfileUrlRedirect.ashx</uri></author></entry><entry><title>Announcing the Rock Paper Azure Challenge Grand Tournament</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/glengordon/archive/2011/07/05/announcing-the-rock-paper-azure-challenge-grand-tournament.aspx" /><id>http://blogs.msdn.com/b/glengordon/archive/2011/07/05/announcing-the-rock-paper-azure-challenge-grand-tournament.aspx</id><published>2011-07-05T20:23:26Z</published><updated>2011-07-05T20:23:26Z</updated><content type="html">&lt;p&gt;Have you ever played Rock, Paper, Scissors? Then you already know how to play the game. Now’s your chance to code your own player “bot” and test your skills online against players from seven countries.&lt;/p&gt;  &lt;p&gt;The Grand Prize tournament winner will take home $5,000, Second place wins $1,000 and the 10 runners-up each get $250. Everyone who participates and uploads a bot will receive the official Rock Paper Azure Challenge t-shirt.&lt;/p&gt;  &lt;p&gt;Will your bot have what it takes to crush the coding competition? Play and find out! Visit &lt;a href="http://www.rockpaperazure.com"&gt;http://www.rockpaperazure.com&lt;/a&gt; to sign up, download the tools, and watch screencasts with step-by-step instructions. Entries must be submitted by 6:00 pm Eastern Time on July 13&lt;sup&gt;th&lt;/sup&gt; to be eligible.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10183301" width="1" height="1"&gt;</content><author><name>GlenGordon</name><uri>http://blogs.msdn.com/glengordon/ProfileUrlRedirect.ashx</uri></author></entry><entry><title>Man, go get you some Mango!</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/glengordon/archive/2011/06/29/man-go-get-you-some-mango.aspx" /><id>http://blogs.msdn.com/b/glengordon/archive/2011/06/29/man-go-get-you-some-mango.aspx</id><published>2011-06-29T19:28:09Z</published><updated>2011-06-29T19:28:09Z</updated><content type="html">&lt;p&gt;If you have been working with the Windows Phone Developer Tools for Mango, no doubt you have played around with the emulator some. And as good as that emulator is for testing your apps, what you’ve really been wanting is a way to test your apps on a real device.&lt;/p&gt;  &lt;p&gt;Well, starting today you finally get you chance! As of this morning, you can download Beta 2 of the tools and a beta image of Windows Phone codename Mango that you can&lt;strong&gt; install on your very own retail device&lt;/strong&gt;, regardless of carrier or brand.&lt;/p&gt;  &lt;p&gt;Check out the full blog post from &lt;a title="developers-get-goody-basket-full-of-mangos.aspx" href="http://windowsteamblog.com/windows_phone/b/wpdev/archive/2011/06/29/developers-get-goody-basket-full-of-mangos.aspx"&gt;the Windows Phone developer blog&lt;/a&gt;. Essentially, they are distributing invitations for those developers registered with &lt;a href="http://create.msdn.com/"&gt;http://create.msdn.com/&lt;/a&gt; so check your email for an invitation.&lt;/p&gt;  &lt;p&gt;Having played with Mango for a little while, I can tell you that the app experience is faster, more responsive, and amazingly well integrated with the phone. Look for some blog posts from me in the near future highlighting new capabilities of the platform!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10181561" width="1" height="1"&gt;</content><author><name>GlenGordon</name><uri>http://blogs.msdn.com/glengordon/ProfileUrlRedirect.ashx</uri></author></entry><entry><title>Atlanta Code Camp 2011 is June 25</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/glengordon/archive/2011/06/15/atlanta-code-camp-2011-is-june-25.aspx" /><id>http://blogs.msdn.com/b/glengordon/archive/2011/06/15/atlanta-code-camp-2011-is-june-25.aspx</id><published>2011-06-15T15:30:18Z</published><updated>2011-06-15T15:30:18Z</updated><content type="html">&lt;p&gt;After a bit of a dry spell, the Atlanta Code Camp is back, and it’s bigger than ever!&lt;/p&gt;  &lt;p&gt;Code Camp is a free event where speakers from the community share their knowledge and expertise with local developers. This year’s Code Camp features &lt;em&gt;&lt;a href="http://www.atlantacodecamp.org/Pages/Agenda2011.aspx"&gt;11 tracks with 54 sessions,&lt;/a&gt;&lt;/em&gt; so it’s sure to have something for everyone.&lt;/p&gt;  &lt;p&gt;Besides the learning you’ll do, the networking at a Code Camp is invaluable. Plus, the after party at Dave and Buster’s should be a blast.&lt;/p&gt;  &lt;p&gt;Join us on Saturday, June 25 at &lt;a href="http://spsu.edu/"&gt;Southern Polytechnic State University&lt;/a&gt; for this great community event.&lt;/p&gt;  &lt;p&gt;Be sure to register at &lt;a href="http://www.atlantacodecamp.org"&gt;http://www.atlantacodecamp.org&lt;/a&gt; to secure your spot today.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10174872" width="1" height="1"&gt;</content><author><name>GlenGordon</name><uri>http://blogs.msdn.com/glengordon/ProfileUrlRedirect.ashx</uri></author></entry><entry><title>Win a Windows Phone at a Windows Phone Garage event in South Carolina</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/glengordon/archive/2011/06/09/win-a-windows-phone-at-a-windows-phone-garage-event-in-south-carolina.aspx" /><id>http://blogs.msdn.com/b/glengordon/archive/2011/06/09/win-a-windows-phone-at-a-windows-phone-garage-event-in-south-carolina.aspx</id><published>2011-06-09T18:12:56Z</published><updated>2011-06-09T18:12:56Z</updated><content type="html">&lt;p&gt;Two great community guys – &lt;a href="http://twitter.com/#!/KodefuGuru"&gt;Chris Eargle&lt;/a&gt; and &lt;a href="http://twitter.com/#!/chrisgwilliams"&gt;Chris Williams&lt;/a&gt; - are setting up community led Windows Phone Garage events next week in Columbia and Greenville.&lt;/p&gt;  &lt;p&gt;Remember, at a Windows Phone Garage you get instruction on the basics of creating Windows Phone apps, but also you get a lot of time to build your app, with help from onsite experts.&lt;/p&gt;  &lt;p&gt;In addition, one attendee who showcases his app (in development or complete) at the event will win a free Windows Phone device!&lt;/p&gt;  &lt;p&gt;Register ASAP and make plans to attend this free event.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://wpgcolumbia.eventbrite.com/"&gt;Columbia, SC&lt;/a&gt; – Thursday, June 16 at Midlands Tech&lt;/p&gt;  &lt;p&gt;&lt;a href="http://wpggreenville.eventbrite.com/"&gt;Greenville, SC&lt;/a&gt; – Friday, June 17 at Immedion&lt;/p&gt;  &lt;p&gt;Tell your friends!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10173020" width="1" height="1"&gt;</content><author><name>GlenGordon</name><uri>http://blogs.msdn.com/glengordon/ProfileUrlRedirect.ashx</uri></author></entry></feed>
