<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Pla.NET Southeast!</title><link>http://blogs.msdn.com/b/glengordon/</link><description>Developer happenings in Georgia, Alabama and Mississippi</description><dc:language>en-US</dc:language><generator>Telligent Evolution Platform Developer Build (Build: 5.6.50428.7875)</generator><item><title>Windows 8 Game Development resources</title><link>http://blogs.msdn.com/b/glengordon/archive/2012/05/24/windows-8-game-development-resources.aspx</link><pubDate>Thu, 24 May 2012 14:10:56 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10309920</guid><dc:creator>GlenGordon</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/glengordon/rsscomments.aspx?WeblogPostID=10309920</wfw:commentRss><comments>http://blogs.msdn.com/b/glengordon/archive/2012/05/24/windows-8-game-development-resources.aspx#comments</comments><description>&lt;p&gt;Earlier this week, for the &lt;a href="http://igdaatlanta.org/"&gt;Atlanta chapter of the International Game Developers Association (IGDA)&lt;/a&gt; I gave an introductory talk on building Metro style games for Windows 8. It was great to see so many folks excited about building games for Windows 8, out of the 50 people who attended, almost all are going to explore doing so. &lt;/p&gt;  &lt;p&gt;Here is a collection of resources that I mentioned that will get you started:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Download the &lt;a href="http://aka.ms/gowin8"&gt;Windows 8 Consumer Preview and the beta for Visual Studio 11&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;Slides from my talk are available in the download &lt;a href="http://www.microsoft.com/en-us/download/details.aspx?id=29206"&gt;Creating a Great Metro Style Game for Windows 8&lt;/a&gt;. &lt;/li&gt;    &lt;li&gt;Videos from our BUILD conference around &lt;a href="http://channel9.msdn.com/events/BUILD/BUILD2011?sort=sequential&amp;amp;direction=desc&amp;amp;term=game"&gt;game development in Windows 8&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;An excellent tutorial on using Expression Blend to &lt;a href="http://blendinsider.com/tutorial/blend-tutorial-part-1-design-your-first-metro-style-app-with-javascript-html5-css-2012-1-20"&gt;design a memory game in HTML5&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/windows/apps/hh465158.aspx"&gt;Create a Metro style game using JavaScript&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/windows/apps/hh465149.aspx"&gt;Create a DirectX game&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://aka.ms/direct3d111"&gt;What’s new in Direct3D 11.1&lt;/a&gt; &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Enjoy!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10309920" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/glengordon/archive/tags/Windows+8/">Windows 8</category></item><item><title>Windows Phone App Challenge at the Atlanta Code Camp</title><link>http://blogs.msdn.com/b/glengordon/archive/2012/05/19/windows-phone-app-challenge-at-the-atlanta-code-camp.aspx</link><pubDate>Sat, 19 May 2012 13:18:52 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10307317</guid><dc:creator>GlenGordon</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/glengordon/rsscomments.aspx?WeblogPostID=10307317</wfw:commentRss><comments>http://blogs.msdn.com/b/glengordon/archive/2012/05/19/windows-phone-app-challenge-at-the-atlanta-code-camp.aspx#comments</comments><description>&lt;p&gt;Today, at the Atlanta Code Camp, I just announced the Windows Phone App Challenge of the day.&lt;/p&gt;
&lt;p&gt;During the event, between sessions, build a Windows Phone app around the theme of Summer, show it off at the end of the day, and win prizes!&lt;/p&gt;
&lt;p&gt;Some idea around the theme would be vacations, cookouts, camps, the beach, Independence Day, etc.&lt;/p&gt;
&lt;p&gt;The best 3 apps (by audience voting at the closing keynote) will win prizes, including a Windows Phone.&lt;/p&gt;
&lt;p&gt;Find me onsite for more information.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10307317" width="1" height="1"&gt;</description></item><item><title>Microsoft is hiring an IT Pro Evangelist in Atlanta</title><link>http://blogs.msdn.com/b/glengordon/archive/2012/05/15/microsoft-is-hiring-an-it-pro-evangelist-in-atlanta.aspx</link><pubDate>Tue, 15 May 2012 20:18:33 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10305548</guid><dc:creator>GlenGordon</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/glengordon/rsscomments.aspx?WeblogPostID=10305548</wfw:commentRss><comments>http://blogs.msdn.com/b/glengordon/archive/2012/05/15/microsoft-is-hiring-an-it-pro-evangelist-in-atlanta.aspx#comments</comments><description>&lt;p&gt;If you are passionate about spreading the word about the awesomeness of Microsoft’s technologies, programs and partnership opportunities to IT Professionals far and wide,, have we got a job for you. We’re hiring an evangelist to reach the IT Professional communities around the southeast and online. Let me know if you have the skills and the drive to fill this role!&lt;/p&gt;  &lt;p&gt;&lt;em&gt;Have you been paying attention to the competitive market dynamics taking place around cloud computing - public, private, hybrid. Do you love technology? Do you like to share your technical knowledge with others? If you are a strong technical talent with experience and passion, our IT Pro Evangelism Team wants to meet you!     &lt;br /&gt;The IT Professional Evangelist (ITE) is a member of the East Region Developer and Platform Evangelism (DPE) team tasked with driving IT Professional platform adoption through a variety of channels: events, community groups, industry influencers and online capabilities. This is a highly technical role with the mission of inspiring the broad community of IT professionals and impacting adoption of Microsoft core infrastructure technologies such as Windows Server “8”, System Center, Private cloud, Hyper-V and Virtualization technologies, SQL Server 2012, Windows 7 and other emerging core infrastructure technologies. The ITE leads by example and invests heavily in cultivating productive, influential partners and community leaders.      &lt;br /&gt;This role is responsible for:      &lt;br /&gt;- Driving next generation virtualization technologies, Windows Server platform and private cloud adoption through evaluations and deployment      &lt;br /&gt;- Drive satisfaction with Microsoft, Microsoft tools and Microsoft platform technologies      &lt;br /&gt;- Engage the broad IT professional community in partnership with community leaders, industry influencers and online channels      &lt;br /&gt;- Deliver IT Pro oriented events/workshops/presentations on the next generation virtualization technologies, Windows Server platform and private cloud technologies       &lt;br /&gt;- Partner with other groups within Microsoft to scale the message      &lt;br /&gt;Description of experiences desired      &lt;br /&gt;Strong candidates should have minimum a 4 year degree, already involved with the IT professional community and experience delivering outstanding presentations to audiences of various sizes along with persuasive communication skills. Candidates should also possess broad familiarity with Microsoft technologies along with competitive platform knowledge and certification in both is desired. Passion for technology with solid knowledge of enterprise global IT requirements and competitive offerings is a must for this role. Moderate travel (20-30%) is anticipated and the preferred location is Washington D.C. or Atlanta, Georgia.&lt;/em&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10305548" width="1" height="1"&gt;</description></item><item><title>PhoneGap on WP7 Tip #8: Alarms and Reminders</title><link>http://blogs.msdn.com/b/glengordon/archive/2012/05/15/phonegap-on-wp7-tip-8-alarms-and-reminders.aspx</link><pubDate>Tue, 15 May 2012 16:24:33 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10305450</guid><dc:creator>GlenGordon</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/glengordon/rsscomments.aspx?WeblogPostID=10305450</wfw:commentRss><comments>http://blogs.msdn.com/b/glengordon/archive/2012/05/15/phonegap-on-wp7-tip-8-alarms-and-reminders.aspx#comments</comments><description>&lt;p&gt;One of the key design decisions the design team made when creating Windows Phone was a focus on providing maximum battery life for the end user. And it seems a major contributor to short battery life is having applications running in the background. So it’s important to realize that apps you create for Windows Phone (including PhoneGap) are paused when the user switches away from them. But frequently, you want to provide information to the user while your application is not in the foreground. There are many ways to do this, including various background tasks and notifications.&lt;/p&gt;  &lt;p&gt;We’re going to look at a particular kind of background task today – the ability to set custom Alarms and Reminders. These alarms and reminders can show alerts to the user when your app is not running, and can be used to launch your app either to the starting page or to a deeper page in the app by using a URI to another page as I showed &lt;a href="http://blogs.msdn.com/b/glengordon/archive/2012/01/10/phonegap-on-wp7-tip-5-live-tiles-and-deep-linking.aspx"&gt;here&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;Read up on &lt;a href="http://msdn.microsoft.com/en-us/library/hh202946(v=VS.92).aspx"&gt;Alarms and Reminders&lt;/a&gt;, and then follow along as we interact with them from a PhoneGap app.&lt;/p&gt;  &lt;p&gt;Begin by creating the plugin class like I showed &lt;a href="http://blogs.msdn.com/b/glengordon/archive/2012/03/02/phonegap-on-wp7-tip-6-trial-mode.aspx"&gt;here&lt;/a&gt;. Here’s the code for the plugin class that I’m calling &lt;strong&gt;scheduler.cs&lt;/strong&gt;. Notice I’m using the latest template for Cordova so some of the references are a little different from previous samples. &lt;/p&gt;  &lt;div id="codeSnippetWrapper"&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" id="codeSnippet"&gt;&lt;span style="color: #0000ff"&gt;using&lt;/span&gt; System;&lt;br /&gt;&lt;span style="color: #0000ff"&gt;using&lt;/span&gt; System.Net;&lt;br /&gt;&lt;span style="color: #0000ff"&gt;using&lt;/span&gt; System.Runtime.Serialization;&lt;br /&gt;&lt;span style="color: #0000ff"&gt;using&lt;/span&gt; Microsoft.Phone.Tasks;&lt;br /&gt;&lt;span style="color: #0000ff"&gt;using&lt;/span&gt; WP7CordovaClassLib.Cordova.Commands;&lt;br /&gt;&lt;span style="color: #0000ff"&gt;using&lt;/span&gt; Microsoft.Phone.Scheduler;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #0000ff"&gt;namespace&lt;/span&gt; WP7CordovaClassLib.Cordova.Commands&lt;br /&gt;{&lt;br /&gt;    &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; scheduler : BaseCommand&lt;br /&gt;    {&lt;br /&gt;&lt;br /&gt;          &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; alarmOptions&lt;br /&gt;        {&lt;br /&gt;&lt;br /&gt;            [DataMember]&lt;br /&gt;            &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; content;&lt;br /&gt;&lt;br /&gt;            [DataMember]&lt;br /&gt;            &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; DateTime beginTime;&lt;br /&gt;&lt;br /&gt;            [DataMember]&lt;br /&gt;            &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; DateTime expirationTime;&lt;br /&gt;&lt;br /&gt;            [DataMember]&lt;br /&gt;            &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; RecurrenceInterval recurrence;&lt;br /&gt;&lt;br /&gt;            [DataMember]&lt;br /&gt;            &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; Uri sound;&lt;br /&gt;&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; addAlarm(&lt;span style="color: #0000ff"&gt;string&lt;/span&gt; options)&lt;br /&gt;        {&lt;br /&gt;            &lt;span style="color: #008000"&gt;// Generate a unique name for the new notification. You can choose a&lt;/span&gt;&lt;br /&gt;            &lt;span style="color: #008000"&gt;// name that is meaningful for your app, or just use a GUID.&lt;/span&gt;&lt;br /&gt;            String name = System.Guid.NewGuid().ToString();&lt;br /&gt;                        &lt;br /&gt;            Alarm alarm = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; Alarm(name);&lt;br /&gt;&lt;br /&gt;            alarmOptions opts = JSON.JsonHelper.Deserialize&amp;lt;alarmOptions&amp;gt;(options);&lt;br /&gt;           &lt;br /&gt;            alarm.Content = opts.content;&lt;br /&gt;            alarm.BeginTime = opts.beginTime;&lt;br /&gt;            &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (opts.expirationTime &amp;gt; opts.beginTime)&lt;br /&gt;                alarm.ExpirationTime = opts.expirationTime;&lt;br /&gt;            &lt;br /&gt;            &lt;span style="color: #0000ff"&gt;if&lt;/span&gt;(opts.recurrence != &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;)&lt;br /&gt;                alarm.RecurrenceType = opts.recurrence;&lt;br /&gt;            &lt;br /&gt;            &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (opts.sound != &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;)&lt;br /&gt;                alarm.Sound = opts.sound;&lt;br /&gt;&lt;br /&gt;            ScheduledActionService.Add(alarm);&lt;br /&gt;&lt;br /&gt;            PluginResult result = &lt;br /&gt;                &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; PluginResult(PluginResult.Status.OK, name);&lt;br /&gt;&lt;br /&gt;            &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.DispatchCommandResult(result);&lt;br /&gt;        }   &lt;br /&gt;&lt;br /&gt;   &lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;

  &lt;br /&gt;&lt;/div&gt;

&lt;p&gt;A couple of things to note. First, you’ll see there’s a &lt;a href="http://msdn.microsoft.com/en-us/library/microsoft.phone.scheduler.recurrenceinterval(v=VS.92).aspx"&gt;RecurrenceInterval&lt;/a&gt; type that the Alarm (and Notification) class uses. It’s an enumeration with values like None, Weekly, Daily, etc. We’ll be passing a numerical value in here later. Also note the URL of a custom sound the alarm can play. That’s just an MP3 or WAV file you put in the project directory for your application. Finally, we’re creating a unique name for the alarm by using a GUID. That’s just a string that’s guaranteed to be unique. We’re returning the GUID so that the calling application can keep track of the alarms it creates if it wants to change or cancel them later. You could also alter this plugin to allow you to pass a unique name yourself instead.&lt;/p&gt;

&lt;p&gt;For the JavaScript side of the plugin, create a file called &lt;strong&gt;scheduler.js&lt;/strong&gt; and add this code.&lt;/p&gt;

&lt;div id="codeSnippetWrapper"&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" id="codeSnippet"&gt;PhoneGap.addConstructor(&lt;span style="color: #0000ff"&gt;function&lt;/span&gt; () {&lt;br /&gt;    &lt;br /&gt;    navigator.plugins.scheduler =&lt;br /&gt;    {&lt;br /&gt;         addAlarm: &lt;span style="color: #0000ff"&gt;function&lt;/span&gt; (callback, content, beginTime, expirationTime, recurrence, sound) {&lt;br /&gt;            &lt;span style="color: #0000ff"&gt;var&lt;/span&gt; options = {&lt;br /&gt;                &lt;span style="color: #006080"&gt;&amp;quot;content&amp;quot;&lt;/span&gt;: content,&lt;br /&gt;                &lt;span style="color: #006080"&gt;&amp;quot;beginTime&amp;quot;&lt;/span&gt;: beginTime,&lt;br /&gt;                &lt;span style="color: #006080"&gt;&amp;quot;expirationTime&amp;quot;&lt;/span&gt;: expirationTime,&lt;br /&gt;                &lt;span style="color: #006080"&gt;&amp;quot;recurrence&amp;quot;&lt;/span&gt;: recurrence,&lt;br /&gt;                &lt;span style="color: #006080"&gt;&amp;quot;sound&amp;quot;&lt;/span&gt;: sound&lt;br /&gt;            };&lt;br /&gt;            PhoneGap.exec(callback, &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;, &lt;span style="color: #006080"&gt;&amp;quot;scheduler&amp;quot;&lt;/span&gt;, &lt;span style="color: #006080"&gt;&amp;quot;addAlarm&amp;quot;&lt;/span&gt;, options);&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;});&lt;/pre&gt;

  &lt;br /&gt;With this in place, it’s very simple to set an alarm. Make sure you add a &amp;lt;script&amp;gt; reference to the HTML page, then add a function like this, which sets an alarm for 1 minute in the future to walk the dog.&lt;/div&gt;

&lt;div&gt;&amp;#160;&lt;/div&gt;

&lt;div id="codeSnippetWrapper"&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" id="codeSnippet"&gt;&lt;span style="color: #0000ff"&gt;function&lt;/span&gt; addAlarm() {&lt;br /&gt;    &lt;span style="color: #0000ff"&gt;var&lt;/span&gt; alarmTime = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; Date(); &lt;br /&gt;    alarmTime.setMinutes(alarmTime.getMinutes() + 1);&lt;br /&gt;    &lt;span style="color: #0000ff"&gt;var&lt;/span&gt; alarmMessage = &lt;span style="color: #006080"&gt;&amp;quot;Walk the dog&amp;quot;&lt;/span&gt;;&lt;br /&gt;    navigator.plugins.scheduler.addAlarm(addAlarmCallback, alarmMessage, alarmTime, &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;, 0, &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;);&lt;br /&gt;}&lt;br /&gt;&lt;span style="color: #0000ff"&gt;function&lt;/span&gt; addAlarmCallback(alarmName) {&lt;br /&gt;    navigator.notification.alert(&lt;span style="color: #006080"&gt;&amp;quot;Alarm created named: &amp;quot;&lt;/span&gt; + alarmName);&lt;br /&gt;}&lt;/pre&gt;

  &lt;br /&gt;Notice we have to pass a zero (for a RecurrenceType of &lt;strong&gt;None&lt;/strong&gt;) for the recurrence interval. To make the code clearer, we can add this code to the very top of the &lt;strong&gt;scheduler.js&lt;/strong&gt; function:&lt;/div&gt;

&lt;div&gt;&amp;#160;&lt;/div&gt;

&lt;div id="codeSnippetWrapper"&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" id="codeSnippet"&gt;&lt;span style="color: #0000ff"&gt;var&lt;/span&gt; RecurrenceInterval =&lt;br /&gt;    { &lt;br /&gt;     &lt;span style="color: #006080"&gt;&amp;quot;None&amp;quot;&lt;/span&gt;: 0,&lt;br /&gt;     &lt;span style="color: #006080"&gt;&amp;quot;Daily&amp;quot;&lt;/span&gt;: 1,&lt;br /&gt;     &lt;span style="color: #006080"&gt;&amp;quot;Weekly&amp;quot;&lt;/span&gt;: 2,&lt;br /&gt;     &lt;span style="color: #006080"&gt;&amp;quot;Monthly&amp;quot;&lt;/span&gt;: 3,&lt;br /&gt;     &lt;span style="color: #006080"&gt;&amp;quot;EndOfMonth&amp;quot;&lt;/span&gt;: 4,&lt;br /&gt;     &lt;span style="color: #006080"&gt;&amp;quot;Yearly&amp;quot;&lt;/span&gt;:5 &lt;br /&gt;     };&lt;/pre&gt;

  &lt;br /&gt;&lt;/div&gt;

&lt;div&gt;Then our call to addAlarm becomes easier to read.&lt;/div&gt;

&lt;div&gt;&amp;#160;&lt;/div&gt;

&lt;div id="codeSnippetWrapper"&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" id="codeSnippet"&gt;navigator.plugins.scheduler.addAlarm(addAlarmCallback, alarmMessage, alarmTime, &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;, RecurrenceInterval.None, &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;);&lt;/pre&gt;

  &lt;br /&gt;&lt;/div&gt;

&lt;p&gt;Following this pattern you could add an addReminder function to the scheduler.cs and scheduler.js files, with the slightly different parameters a Reminder expects. You could also query the system for a list of existing Alarms and Reminders so the user could manage them.&lt;/p&gt;

&lt;p&gt;So don’t be alarmed (pun intended), go ahead and add these features to your PhoneGap apps!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10305450" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/glengordon/archive/tags/PhoneGap/">PhoneGap</category></item><item><title>Atlanta Code Camp–this weekend!</title><link>http://blogs.msdn.com/b/glengordon/archive/2012/05/14/atlanta-code-camp-this-weekend.aspx</link><pubDate>Mon, 14 May 2012 14:25:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10304874</guid><dc:creator>GlenGordon</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/glengordon/rsscomments.aspx?WeblogPostID=10304874</wfw:commentRss><comments>http://blogs.msdn.com/b/glengordon/archive/2012/05/14/atlanta-code-camp-this-weekend.aspx#comments</comments><description>&lt;p&gt;The best free developer event in town is the Atlanta Code Camp. It&amp;rsquo;s free, it&amp;rsquo;s fun, it&amp;rsquo;s educational, and it&amp;rsquo;s this weekend (May 19).&lt;/p&gt;
&lt;p&gt;Join 300 of your fellow geeks learning about the latest developer technologies, techniques and best practices from some of the best speakers around. Network, hang out, get fed, and have fun!&lt;/p&gt;
&lt;p&gt;During the Code Camp, we&amp;rsquo;ll have a Windows Phone App Challenge. We&amp;rsquo;ll announce a &amp;ldquo;theme&amp;rdquo; at the beginning of the code camp. The teams (team of one is OK) who create the best Windows Phone apps during the day will get to show off their apps at the closing ceremonies and win great prizes. Form your team ahead of time or find folks at the event, and have a blast.&lt;/p&gt;
&lt;p&gt;Register now at &lt;a href="http://www.atlantacodecamp.org"&gt;http://www.atlantacodecamp.org&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=10304874" width="1" height="1"&gt;</description></item><item><title>Nokia Coding Challenge coming to Atlanta on May 15</title><link>http://blogs.msdn.com/b/glengordon/archive/2012/05/07/nokia-coding-challenge-coming-to-atlanta-on-may-15.aspx</link><pubDate>Mon, 07 May 2012 20:19:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10301957</guid><dc:creator>GlenGordon</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/glengordon/rsscomments.aspx?WeblogPostID=10301957</wfw:commentRss><comments>http://blogs.msdn.com/b/glengordon/archive/2012/05/07/nokia-coding-challenge-coming-to-atlanta-on-may-15.aspx#comments</comments><description>&lt;p&gt;&lt;img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" title="450x200-readysetcode-challenge-banner" border="0" alt="450x200-readysetcode-challenge-banner" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-31-52-metablogapi/2352.450x200_2D00_readysetcode_2D00_challenge_2D00_banner_5F00_thumb.jpg" width="454" height="204" /&gt;&lt;/p&gt;
&lt;p&gt;Headphones on. Tilt the seat back. Just steady codin&amp;rsquo; as the keys get tapped. Get ready, because Nokia Developer is about to turn &lt;a href="http://bhcatlanta-eorg.eventbrite.com/"&gt;Atlanta&lt;/a&gt;(&lt;a href="http://www.nokiadeveloper.eventbrite.com/"&gt;and other cities&lt;/a&gt;) into Dev City with its &lt;a href="http://www.nokiadeveloper.eventbrite.com/"&gt;&lt;b&gt;Ready.Set () {Code} Challenge&lt;/b&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;They are hitting the road to 13-cities looking for developers who want to build an experience - not just another app. To kick off the Ready.Set () {Code} Challenge, Nokia Developer will hold hackathons across the US and Canada beginning in May. You can sign up individually or form your own team to build the coolest, baddest apps for the Windows Phone platform and Nokia Lumia devices.&lt;/p&gt;
&lt;p&gt;Prizes will be awarded on site at each event for the top 3 created apps, top student created app, and most Nokia-branded developer (use your imagination). App winners will be judged on creativity, usability, technical difficulty and app presentation.&lt;/p&gt;
&lt;p&gt;1&lt;sup&gt;st&lt;/sup&gt; place: $500 gift card &amp;amp; Nokia Lumia 900&lt;/p&gt;
&lt;p&gt;2&lt;sup&gt;nd&lt;/sup&gt; place: $250 gift card &amp;amp; Nokia Lumia 900&lt;/p&gt;
&lt;p&gt;3&lt;sup&gt;rd&lt;/sup&gt; place: $100 gift card &amp;amp; Nokia Lumia 900&lt;/p&gt;
&lt;p&gt;Student Winner: $150 gift card &amp;amp; Nokia Lumia 900&lt;/p&gt;
&lt;p&gt;Most Nokia-Branded Dev :&amp;nbsp; $100 gift card &amp;amp; Nokia Lumia 900&lt;/p&gt;
&lt;p&gt;At Nokia, they don&amp;rsquo;t have ordinary developers, so these won&amp;rsquo;t be ordinary hacks. They have some amazing experiences in store &amp;ndash; like the Re-Charge Room - for developers to chill out between pounding out code. So come show off your skills and earn rewards. Space will be limited so &lt;a href="http://bhcatlanta-eorg.eventbrite.com/"&gt;register&lt;/a&gt; early.&lt;/p&gt;
&lt;p&gt;The Challenge is on. See you in Atlanta on May 15! Make sure you are prepared - show up to the event with the &lt;a href="http://www.microsoft.com/click/services/Redirect2.ashx?CR_CC=200082778"&gt;Windows Phone developer tools&lt;/a&gt; installed on your machines.&lt;/p&gt;
&lt;p&gt;For some great tips on getting ready for the event, read my colleague Joe Healy&amp;rsquo;s &lt;a href="http://devfish.net/fullblogitemview.aspx?blogid=903"&gt;great blog post&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=10301957" width="1" height="1"&gt;</description></item><item><title>Next week, learn about Windows 8 and tour a great coworking facility</title><link>http://blogs.msdn.com/b/glengordon/archive/2012/05/04/next-week-learn-about-windows-8-and-tour-a-great-coworking-facility.aspx</link><pubDate>Fri, 04 May 2012 18:32:33 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10301116</guid><dc:creator>GlenGordon</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/glengordon/rsscomments.aspx?WeblogPostID=10301116</wfw:commentRss><comments>http://blogs.msdn.com/b/glengordon/archive/2012/05/04/next-week-learn-about-windows-8-and-tour-a-great-coworking-facility.aspx#comments</comments><description>&lt;p&gt;On Wednesday of next week, I’ll be giving a talk on what’s coming in Windows 8 for app developers and startups. I’ll be presenting this as a benefit to members (current and prospective) of a local coworking facility &lt;a href="http://workatthespot.com/"&gt;The Work Spot&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;So grab yourself some takeout, stop on by for some learning, take a tour of the place, and maybe win a prize!&lt;/p&gt;  &lt;p&gt;Wednesday, May 9, noon    &lt;br /&gt;Learn@Lunch     &lt;br /&gt;The Work Spot     &lt;br /&gt;3150 Main Street, Suite 103     &lt;br /&gt;Duluth, Georgia 30096&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10301116" width="1" height="1"&gt;</description></item><item><title>Announcing the launch of The Campus Coder podcast series</title><link>http://blogs.msdn.com/b/glengordon/archive/2012/05/03/announcing-the-launch-of-the-campus-coder-podcast-series.aspx</link><pubDate>Thu, 03 May 2012 15:01:59 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10300445</guid><dc:creator>GlenGordon</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/glengordon/rsscomments.aspx?WeblogPostID=10300445</wfw:commentRss><comments>http://blogs.msdn.com/b/glengordon/archive/2012/05/03/announcing-the-launch-of-the-campus-coder-podcast-series.aspx#comments</comments><description>&lt;p&gt;Good news, everyone! My colleague &lt;a href="http://www.creepyed.com/"&gt;Ed Donahue&lt;/a&gt; and I have launched a new podcast series called The Campus Coder.&lt;/p&gt;  &lt;p&gt;The weekly half-hour podcast series features interviews with student developers who have made the leap into professional development with Microsoft tools. It’s intended to educate, entertain and enlighten aspiring student developers!&lt;/p&gt;  &lt;p&gt;The home page for the series is &lt;a href="http://aka.ms/thecampuscoder"&gt;http://aka.ms/thecampuscoder&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Facebook page &lt;a href="http://facebook.com/thecampuscoder"&gt;http://facebook.com/thecampuscoder&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Twitter &lt;a href="http://twitter.com/thecampuscoder"&gt;http://twitter.com/thecampuscoder&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Check it out and let us know what you think! Also, send us guests!!!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10300445" width="1" height="1"&gt;</description></item><item><title>Learn The Cloud. Make A Difference. @home with Windows Azure</title><link>http://blogs.msdn.com/b/glengordon/archive/2012/04/10/learn-the-cloud-make-a-difference-home-with-windows-azure.aspx</link><pubDate>Tue, 10 Apr 2012 21:24:28 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10292413</guid><dc:creator>GlenGordon</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/glengordon/rsscomments.aspx?WeblogPostID=10292413</wfw:commentRss><comments>http://blogs.msdn.com/b/glengordon/archive/2012/04/10/learn-the-cloud-make-a-difference-home-with-windows-azure.aspx#comments</comments><description>&lt;p&gt;How does learning about cloud computing while contributing to scientific research sound to you? Join us for &lt;a href="http://bit.ly/athomepcl"&gt;@home with Windows Azure&lt;/a&gt; to get a solid understanding of the Windows Azure platform while giving back to a very deserving cause.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://bit.ly/athomepcl"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto; padding-top: 0px" title="athome_header_gfxUSCloudAdTake1" border="0" alt="athome_header_gfxUSCloudAdTake1" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-31-52-metablogapi/4760.athome_5F00_header_5F00_gfxUSCloudAdTake1_5F00_3.png" width="644" height="191" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;h2&gt;What is @home with Windows Azure?&lt;/h2&gt;  &lt;p&gt;Microsoft provides a &lt;a href="http://www.microsoft.com/click/services/Redirect2.ashx?CR_CC=200082762"&gt;90-day free trial of Windows Azure&lt;/a&gt; where you can kick the tires and run an application in the cloud 24x7, cost-free. Why not use that free compute time to give back to a deserving cause?&amp;#160; The &lt;a href="http://bit.ly/athomepcl"&gt;@home with Windows Azure&lt;/a&gt; project is an online activity where you use those &lt;a href="http://www.microsoft.com/click/services/Redirect2.ashx?CR_CC=200082762"&gt;90-days of free compute time&lt;/a&gt; (or your &lt;a href="http://www.windowsazure.com/en-us/pricing/member-offers/msdn-benefits/"&gt;MSDN Subscriber benefits&lt;/a&gt;) to contribute to &lt;a href="http://folding.stanford.edu/"&gt;Stanford University’s Folding@home&lt;/a&gt; distributed computing project.&lt;/p&gt;  &lt;p&gt;The Folding@home project helps scientists provide insight into the causes of diseases such as Alzheimer’s, Mad Cow disease, ALS, and some cancer-related syndromes, by running &lt;a href="http://folding.stanford.edu/English/Science"&gt;&lt;em&gt;protein folding&lt;/em&gt;&lt;/a&gt; simulations on thousands of machines world wide.&lt;/p&gt;  &lt;p&gt;You will deploy Stanford’s Folding@home application to Windows Azure, where it will execute &lt;a href="http://folding.stanford.edu/English/Science"&gt;protein folding&lt;/a&gt; simulations in the cloud, thus contributing to the research effort. In essence, your participation is a donation of your free compute time to the &lt;a href="http://folding.stanford.edu/"&gt;Folding@home&lt;/a&gt; project!&lt;/p&gt;  &lt;h2&gt;Get Started&lt;/h2&gt;  &lt;p&gt;It’s easy to get started in 4 quick steps. The &lt;a href="http://bit.ly/athomepcl"&gt;@home with Windows Azure&lt;/a&gt; site has a series of short, easy to follow along to, screencasts that walk you through deploying Folding@home to the cloud!&lt;/p&gt;  &lt;h2&gt;Learn The Cloud &lt;/h2&gt;  &lt;p&gt;Want to go deeper? Join the &lt;a href="http://bit.ly/athomepcl"&gt;@home team&lt;/a&gt; for a live webcast or catch one of their recordings on demand to learn more about Windows Azure, including: compute &amp;amp; storage services, debugging in the cloud, and patterns for achieving scale.&lt;/p&gt;  &lt;h2&gt;Make A Difference&lt;/h2&gt;  &lt;p&gt;In addition to directly contributing CPU cycles to the Folding@home project, from the start of March 2012, &lt;strong&gt;Microsoft is donating $10 (up to a maximum of $5000) to Stanford’s Pande Lab for everyone that participates!&lt;/strong&gt;&lt;/p&gt;  &lt;h2&gt;See Your Impact&lt;/h2&gt;  &lt;p&gt;You can see your impact by visiting the detailed World Stats page on the &lt;a href="http://bit.ly/athomepcl"&gt;@home with Windows Azure&lt;/a&gt; site.&amp;#160; For example, to date, over 6,300 VMs have contributed over 3.5 million compute hours!!!&lt;/p&gt;  &lt;p&gt;Learn more about the project and join in at the project’s website: &lt;a href="http://bit.ly/athomepcl"&gt;&lt;strong&gt;http://distributedcomputing.cloudapp.net&lt;/strong&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=10292413" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/glengordon/archive/tags/Azure/">Azure</category></item><item><title>Windows Phone 101 series kicking off in Atlanta</title><link>http://blogs.msdn.com/b/glengordon/archive/2012/04/03/windows-phone-101-series-kicking-off-in-atlanta.aspx</link><pubDate>Tue, 03 Apr 2012 15:00:54 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10290377</guid><dc:creator>GlenGordon</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/glengordon/rsscomments.aspx?WeblogPostID=10290377</wfw:commentRss><comments>http://blogs.msdn.com/b/glengordon/archive/2012/04/03/windows-phone-101-series-kicking-off-in-atlanta.aspx#comments</comments><description>&lt;p&gt;If you have been wanting to learn how to write and publish Windows Phone apps, here’s a great opportunity to get started in the Atlanta area. The &lt;a href="http://www.meetup.com/Win-Phone-7-Developers-Atlanta/"&gt;Windows Phone meetup&lt;/a&gt; here is kicking off off a 7 part series of events that will teach you how to do it. Between now and June, attend these events, build and publish an app, and you can win great prizes.&lt;/p&gt;  &lt;p&gt;Visit the &lt;a href="http://www.meetup.com/Win-Phone-7-Developers-Atlanta/"&gt;group’s meetup page to sign up&lt;/a&gt;. The series kicks off tonight, April 3. Join us for as many of these as you can attend!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10290377" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/glengordon/archive/tags/Windows+Phone+7/">Windows Phone 7</category></item><item><title>PhoneGap on WP7 Tip #7: Marketplace tricks</title><link>http://blogs.msdn.com/b/glengordon/archive/2012/03/30/phonegap-on-wp7-tip-7-marketplace-tricks.aspx</link><pubDate>Fri, 30 Mar 2012 21:48:11 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10289558</guid><dc:creator>GlenGordon</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/glengordon/rsscomments.aspx?WeblogPostID=10289558</wfw:commentRss><comments>http://blogs.msdn.com/b/glengordon/archive/2012/03/30/phonegap-on-wp7-tip-7-marketplace-tricks.aspx#comments</comments><description>&lt;p&gt;This is a quick follow up tip to the &lt;a href="http://blogs.msdn.com/b/glengordon/archive/2012/03/02/phonegap-on-wp7-tip-6-trial-mode.aspx"&gt;last one I posted about using Trial Mode&lt;/a&gt; with a PhoneGap application on Windows phone.&lt;/p&gt;  &lt;p&gt;As I mentioned in that article, having your application available for users to try without laying out any money is a great way to grab them as a customer. But successfully converting them is about more than just limiting the functionality. It’s about driving your desired behaviors for them. This can be prompting them to download your app, review it (good reviews are another key marketing tool in the marketplace) or even seeing other apps published by you in the marketplace.&lt;/p&gt;  &lt;p&gt;Fortunately, there is an easy way to do this through the Marketplace tasks that are available to us. We will add a way to call those relevant tasks from PhoneGap by using the Marketplace Plugin from the previous article.&lt;/p&gt;  &lt;p&gt;Revisiting the code from the previous article, we need to make a few changes. First, add this statement at the top of the marketplace.cs file.&lt;/p&gt;  &lt;div id="codeSnippetWrapper"&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" id="codeSnippet"&gt;&lt;span style="color: #0000ff"&gt;using&lt;/span&gt; Microsoft.Phone.Tasks;&lt;/pre&gt;

  &lt;br /&gt;&lt;/div&gt;

&lt;p&gt;Then, add a wrapper for the task to show the detail in the Marketplace for the current application using the &lt;a title="http://msdn.microsoft.com/en-us/library/microsoft.phone.tasks.marketplacedetailtask(v=vs.92).aspx" href="http://msdn.microsoft.com/en-us/library/microsoft.phone.tasks.marketplacedetailtask(v=vs.92).aspx"&gt;MarketplaceDetailTask&lt;/a&gt; class. &lt;/p&gt;

&lt;div id="codeSnippetWrapper"&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" id="codeSnippet"&gt;&lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; showInMarketplace(&lt;span style="color: #0000ff"&gt;string&lt;/span&gt; args)&lt;br /&gt;{&lt;br /&gt;    MarketplaceDetailTask _marketplaceDetailTask = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; MarketplaceDetailTask();&lt;br /&gt;    _marketplaceDetailTask.Show();&lt;br /&gt;}&lt;/pre&gt;

  &lt;br /&gt;&lt;/div&gt;

&lt;p&gt;This does not return a result to the calling JavaScript code, so you don’t need the DispatchCommandResult call as in the previous article.&lt;/p&gt;

&lt;p&gt;Next up, a JavaScript wrapper in the marketplace.js file.&lt;/p&gt;

&lt;div&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" id="codeSnippet"&gt;marketplace.prototype.showInMarketplace = &lt;span style="color: #0000ff"&gt;function&lt;/span&gt; () {&lt;br /&gt;    &lt;span style="color: #0000ff"&gt;var&lt;/span&gt; args = {}&lt;br /&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;Marketplace&amp;quot;&lt;/span&gt;, &lt;span style="color: #006080"&gt;&amp;quot;showInMarketplace&amp;quot;&lt;/span&gt;, args);&lt;br /&gt;}&lt;/pre&gt;
&lt;/div&gt;

&lt;div&gt;&amp;#160;&lt;/div&gt;

&lt;div&gt;A small change to the index.html page will let us provide the user with a way to quickly jump to the marketplace and buy the app.&lt;/div&gt;

&lt;div&gt;&amp;#160;&lt;/div&gt;

&lt;div id="codeSnippetWrapper"&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" id="codeSnippet"&gt;function licenseCallback(isTrial) {&lt;br /&gt;    if (isTrial) {&lt;br /&gt;        licenseDiv.innerHTML = &lt;br /&gt;        'Trial mode, please &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;a&lt;/span&gt; &lt;span style="color: #ff0000"&gt;onClick&lt;/span&gt;=&lt;span style="color: #ff0000"&gt;window&lt;/span&gt;.&lt;span style="color: #ff0000"&gt;plugins&lt;/span&gt;.&lt;span style="color: #ff0000"&gt;marketplace&lt;/span&gt;.&lt;span style="color: #ff0000"&gt;showInMarketplace&lt;/span&gt;();&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;buy me&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;a&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;!';&lt;br /&gt;    }&lt;br /&gt;    else {&lt;br /&gt;        licenseDiv.innerHTML = 'Thanks for buying!';&lt;br /&gt;    }&lt;/pre&gt;

  &lt;br /&gt;&lt;/div&gt;

&lt;p&gt;If you try this in the phone emulator, you’ll notice a few things. First of all, the marketplace entry won’t display and in fact you’ll get an error. That’s expected, as your app didn’t get installed on the emulator from the marketplace in the first place. Be assured it will certainly work once your app is published. Second, after you go to the marketplace and then press the back button to return to the app, you get prompted to simulate trial or full mode again. That’s not only expected, but by design. If a user upgrades to paid, when they come back to the app, we want to know then. Not when the app is restarted.&lt;/p&gt;

&lt;p&gt;There are other useful marketplace functions, including:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/microsoft.phone.tasks.marketplacehubtask(v=vs.92).aspx"&gt;MarketplaceHubTask&lt;/a&gt; - Allows an application to launch the Windows Phone Marketplace client application.&lt;/li&gt;

  &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/microsoft.phone.tasks.marketplacereviewtask(v=vs.92).aspx"&gt;MarketplaceReviewTask&lt;/a&gt; - Allows an application to launch the Windows Phone Marketplace client application and display the review page for the specified product. This is an EXCELLENT way to encourage reviews, and good reviews are key to a prominent position in the marketplace!&lt;/li&gt;

  &lt;li&gt;&lt;strong&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/microsoft.phone.tasks.marketplacesearchtask(v=vs.92).aspx"&gt;MarketplaceSearchTask&lt;/a&gt;&lt;/strong&gt; - Allows an application to launch the Windows Phone Marketplace client application and display the search results from the specified search terms. You could search for other apps you’ve published by putting the app name or the publisher name in as a parameter to this call. Great for cross selling as in “Like this app? Try the my others!”&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It’s easy to leverage the trial mode and the marketplace API in your PhoneGap apps on Windows Phone to get more purchases!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10289558" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/glengordon/archive/tags/PhoneGap/">PhoneGap</category></item><item><title>Now Available: Windows Phone SDK 7.1.1 Update</title><link>http://blogs.msdn.com/b/glengordon/archive/2012/03/26/now-available-windows-phone-sdk-7-1-1-update.aspx</link><pubDate>Mon, 26 Mar 2012 21:42:43 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10287783</guid><dc:creator>GlenGordon</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/glengordon/rsscomments.aspx?WeblogPostID=10287783</wfw:commentRss><comments>http://blogs.msdn.com/b/glengordon/archive/2012/03/26/now-available-windows-phone-sdk-7-1-1-update.aspx#comments</comments><description>&lt;p&gt;Today the Windows Phone team &lt;a href="http://windowsteamblog.com/windows_phone/b/wpdev/archive/2012/03/26/wpsdk-711-now-available.aspx"&gt;announced &lt;/a&gt;the release of the &lt;a href="http://www.microsoft.com/download/en/details.aspx?id=29233"&gt;Windows Phone SDK 7.1.1 Update&lt;/a&gt;! This is a patch for the &lt;a href="http://www.microsoft.com/click/services/Redirect2.ashx?CR_CC=200082778"&gt;full Windows Phone SDK 7.1&lt;/a&gt; and includes many new capabilities and features for expanding your apps’ reach to new markets and new devices, plus the ability (unsupported) to test your apps on Windows 8.&lt;/p&gt;  &lt;p&gt;Check out the new capabilities:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;b&gt;Updated 512 MB OS Emulator Image&lt;/b&gt;: An updated build Windows Phone OS 7.1 (Build 8773) &lt;/li&gt;    &lt;li&gt;&lt;b&gt;New 256 MB OS Emulator Image&lt;/b&gt;: A new Windows Phone OS 7.1 emulator image (Build 8773) that emulates running on 256 MB devices &lt;/li&gt;    &lt;li&gt;&lt;b&gt;Emulator Choice&lt;/b&gt;: Ability to debug or run your WP apps in either the 256 MB or 512 MB emulator &lt;/li&gt;    &lt;li&gt;&lt;b&gt;Windows 8 Support&lt;/b&gt;: An updated emulator is included, which can run on Windows 8 &lt;/li&gt;    &lt;li&gt;&lt;b&gt;IntelliSense support&lt;/b&gt; for adding the new 512 MB requirement to the Windows Phone App Manifest file &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Here are some other new things the release offers:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;b&gt;‘Go Live’ license&lt;/b&gt;: The update now has a ‘Go Live’ license; developers running WPSDK 7.1.1 are now empowered to publish their Windows Phone apps to the Windows Phone Marketplace.&lt;b&gt; &lt;/b&gt;&lt;/li&gt;    &lt;li&gt;&lt;b&gt;Full Localization&lt;/b&gt;: WPSDK now supports all 10 IDE languages; and the OS image now has Malay and Indonesian &lt;/li&gt;    &lt;li&gt;&lt;b&gt;Windows 8 Support&lt;/b&gt;: The updated emulator will now run on Windows 8; note that the OS is still not officially supported by developer support until the final OS release &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;a href="http://www.microsoft.com/click/services/Redirect2.ashx?CR_CC=200082778"&gt;Download the full SDK today&lt;/a&gt; if you haven’t already, and &lt;a href="http://www.microsoft.com/download/en/details.aspx?id=29233"&gt;add this patch&lt;/a&gt; to be at the latest set of tools for building Windows Phone apps.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10287783" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/glengordon/archive/tags/Windows+Phone+7/">Windows Phone 7</category></item><item><title>Windows 8 Developer Camps – Coming Soon!</title><link>http://blogs.msdn.com/b/glengordon/archive/2012/03/07/windows-8-developer-camps-coming-soon.aspx</link><pubDate>Wed, 07 Mar 2012 22:05:23 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10279416</guid><dc:creator>GlenGordon</dc:creator><slash:comments>1</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/glengordon/rsscomments.aspx?WeblogPostID=10279416</wfw:commentRss><comments>http://blogs.msdn.com/b/glengordon/archive/2012/03/07/windows-8-developer-camps-coming-soon.aspx#comments</comments><description>&lt;p&gt;&lt;a href="http://windows.microsoft.com/en-US/windows-8/consumer-preview"&gt;&lt;img style="background-image: none; border-right-width: 0px; margin: 0px 0px 5px 5px; padding-left: 0px; padding-right: 0px; display: inline; float: right; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="Windows" border="0" alt="Windows" align="right" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-31-52-metablogapi/5228.Windows_5F00_3.png" width="120" height="34" /&gt;&lt;/a&gt;Ready to dive in and learn more about &lt;a href="http://windows.microsoft.com/en-US/windows-8/consumer-preview"&gt;Windows 8&lt;/a&gt; and the developer opportunity it represents?&amp;#160; Then get ready for the series of &lt;strong&gt;Windows Developer Camps&lt;/strong&gt;!&amp;#160; These are free, full-day, developer-focused events featuring a combination of sessions and hands-on labs, and we’ll have 10 of them right here in the east, including one in Atlanta!&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;font face="Segoe UI"&gt;Windows 8 changes everything.        &lt;br /&gt;        &lt;br /&gt;Combining the broad reach of Windows, best-in-class developer tools, a reimagined user experience, support for new chipsets, and a built-in Store with industry-leading business terms — Windows 8 is the largest developer opportunity, ever.         &lt;br /&gt;        &lt;br /&gt;Join us for this &lt;strong&gt;free, full-day event&lt;/strong&gt; designed to share all the knowledge you need to start building Metro-style applications for Windows 8 – today. We’ll begin by showing you how to use Visual Studio to code fast, fluid, immersive and beautiful Metro-style applications in HTML5/JavaScript, XAML/C# and C/C++. Your existing investments in these languages carry forward, making Windows a no-compromise platform for developers.         &lt;br /&gt;        &lt;br /&gt;Whatever language you choose, your app gets deep integration with the Windows shell, including notifications, live tiles, deep links, and contracts with other apps. And now you can build once and support all Windows customers, no matter what type of PC they have – from tablets to laptops to convertibles to desktops.         &lt;br /&gt;        &lt;br /&gt;We’ll cap the day off with an open, &lt;strong&gt;hands-on lab&lt;/strong&gt; session. It’s the perfect opportunity to get your dream application underway, or finish that app you’ve already started – with Windows 8 experts available to guide you through every step. Bring your laptop to join in the fun and show off your killer app.         &lt;br /&gt;        &lt;br /&gt;Get started now!&lt;/font&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;h2&gt;The Schedule&lt;/h2&gt;  &lt;p&gt;Join us in one of these cities:&lt;/p&gt;  &lt;p&gt;   &lt;table style="width: 354pt; border-collapse: collapse" border="0" cellspacing="0" cellpadding="0" width="472"&gt;&lt;colgroup&gt;&lt;col style="width: 116pt; mso-width-source: userset; mso-width-alt: 5632" width="154" /&gt;&lt;col style="width: 113pt; mso-width-source: userset; mso-width-alt: 5522" width="151" /&gt;&lt;col style="width: 125pt; mso-width-source: userset; mso-width-alt: 6107" width="167" /&gt;&lt;/colgroup&gt;&lt;tbody&gt;       &lt;tr style="height: 33.75pt; mso-yfti-irow: 0; mso-yfti-firstrow: yes; mso-height-source: userset" height="45"&gt;         &lt;td style="border-bottom: windowtext 1pt solid; border-left: windowtext 1pt solid; background-color: #8db4e2; width: 354pt; height: 33.75pt; border-top: windowtext 1pt solid; border-right: black 1pt solid" class="xl70" height="45" width="472" colspan="3"&gt;           &lt;p align="center"&gt;&lt;strong&gt;&lt;font color="#ffffff" size="5" face="Segoe UI"&gt;Windows Developer Camps&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt;         &lt;/td&gt;       &lt;/tr&gt;        &lt;tr style="height: 33.75pt; mso-yfti-irow: 1; mso-height-source: userset" height="45"&gt;         &lt;td style="border-bottom: windowtext 1pt solid; border-left: windowtext 1pt solid; background-color: #538dd5; border-top-color: windowtext; width: 116pt; height: 33.75pt; border-right: windowtext 1pt solid" class="xl73" height="45" width="154"&gt;&lt;strong&gt;&lt;font color="#ffffff" size="4" face="Segoe UI"&gt;Date&lt;/font&gt;&lt;/strong&gt;&lt;/td&gt;          &lt;td style="border-bottom: windowtext 1pt solid; background-color: #538dd5; border-top-color: windowtext; width: 113pt; border-left-color: #f0f0f0; border-right: windowtext 1pt solid" class="xl75" width="151"&gt;&lt;strong&gt;&lt;font color="#ffffff" size="4" face="Segoe UI"&gt;City&lt;/font&gt;&lt;/strong&gt;&lt;/td&gt;          &lt;td style="border-bottom: windowtext 1pt solid; background-color: #538dd5; border-top-color: windowtext; width: 125pt; border-left-color: #f0f0f0; border-right: windowtext 1pt solid" class="xl75" width="167"&gt;&lt;strong&gt;&lt;font color="#ffffff" size="4" face="Segoe UI"&gt;More&lt;/font&gt;&lt;/strong&gt;&lt;/td&gt;       &lt;/tr&gt;        &lt;tr style="height: 33.75pt; mso-yfti-irow: 2; mso-height-source: userset" height="45"&gt;         &lt;td style="border-bottom: windowtext 1pt solid; border-left: windowtext 1pt solid; background-color: transparent; border-top-color: windowtext; height: 33.75pt; border-right: windowtext 1pt solid" class="xl74" height="45"&gt;&lt;font face="Segoe UI"&gt;March 27, 2012&lt;/font&gt;&lt;/td&gt;          &lt;td style="border-bottom: windowtext 1pt solid; background-color: transparent; border-top-color: #f0f0f0; border-left-color: #f0f0f0; border-right: windowtext 1pt solid" class="xl66"&gt;&lt;font face="Segoe UI"&gt;Reston, VA&lt;/font&gt;&lt;/td&gt;          &lt;td style="border-bottom: windowtext 1pt solid; background-color: transparent; border-top-color: windowtext; width: 125pt; border-left-color: #f0f0f0; border-right: windowtext 1pt solid" class="xl67" width="167"&gt;&lt;a href="http://www.microsoft.com/click/services/Redirect2.ashx?CR_CC=200090652&amp;amp;CR_EAC=300039457"&gt;&lt;span style="font-family: &amp;quot;Segoe UI&amp;quot;, sans-serif; font-size: 12pt; mso-font-charset: 0"&gt;Details &amp;amp; Registration&lt;/span&gt;&lt;/a&gt;&lt;/td&gt;       &lt;/tr&gt;        &lt;tr style="height: 33.75pt; mso-yfti-irow: 3; mso-height-source: userset" height="45"&gt;         &lt;td style="border-bottom: windowtext 1pt solid; border-left: windowtext 1pt solid; background-color: #f2f2f2; border-top-color: #f0f0f0; height: 33.75pt; border-right: windowtext 1pt solid" class="xl76" height="45"&gt;&lt;font face="Segoe UI"&gt;March 29, 2012&lt;/font&gt;&lt;/td&gt;          &lt;td style="border-bottom: windowtext 1pt solid; background-color: #f2f2f2; border-top-color: #f0f0f0; border-left-color: #f0f0f0; border-right: windowtext 1pt solid" class="xl77"&gt;&lt;font face="Segoe UI"&gt;Chevy Chase, MD&lt;/font&gt;&lt;/td&gt;          &lt;td style="border-bottom: windowtext 1pt solid; background-color: #f2f2f2; border-top-color: #f0f0f0; width: 125pt; border-left-color: #f0f0f0; border-right: windowtext 1pt solid" class="xl78" width="167"&gt;&lt;a href="http://www.microsoft.com/click/services/Redirect2.ashx?CR_CC=200090652&amp;amp;CR_EAC=300039459"&gt;&lt;span style="font-family: &amp;quot;Segoe UI&amp;quot;, sans-serif; font-size: 12pt; mso-font-charset: 0"&gt;Details &amp;amp; Registration&lt;/span&gt;&lt;/a&gt;&lt;/td&gt;       &lt;/tr&gt;        &lt;tr style="height: 33.75pt; mso-yfti-irow: 4; mso-height-source: userset" height="45"&gt;         &lt;td style="border-bottom: windowtext 1pt solid; border-left: windowtext 1pt solid; background-color: transparent; border-top-color: #f0f0f0; height: 33.75pt; border-right: windowtext 1pt solid" class="xl65" height="45"&gt;&lt;font face="Segoe UI"&gt;April 11, 2012&lt;/font&gt;&lt;/td&gt;          &lt;td style="border-bottom: windowtext 1pt solid; background-color: transparent; border-top-color: #f0f0f0; border-left-color: #f0f0f0; border-right: windowtext 1pt solid" class="xl66"&gt;&lt;font face="Segoe UI"&gt;Orlando, FL&lt;/font&gt;&lt;/td&gt;          &lt;td style="border-bottom: windowtext 1pt solid; background-color: transparent; border-top-color: #f0f0f0; width: 125pt; border-left-color: #f0f0f0; border-right: windowtext 1pt solid" class="xl68" width="167"&gt;&lt;a href="http://www.microsoft.com/click/services/Redirect2.ashx?CR_CC=200090652&amp;amp;CR_EAC=300039461"&gt;&lt;span style="font-family: &amp;quot;Segoe UI&amp;quot;, sans-serif; font-size: 12pt; mso-font-charset: 0"&gt;Details &amp;amp; Registration&lt;/span&gt;&lt;/a&gt;&lt;/td&gt;       &lt;/tr&gt;        &lt;tr style="height: 33.75pt; mso-yfti-irow: 5; mso-height-source: userset" height="45"&gt;         &lt;td style="border-bottom: windowtext 1pt solid; border-left: windowtext 1pt solid; background-color: #f2f2f2; border-top-color: #f0f0f0; height: 33.75pt; border-right: windowtext 1pt solid" class="xl76" height="45"&gt;&lt;font face="Segoe UI"&gt;April 17, 2012&lt;/font&gt;&lt;/td&gt;          &lt;td style="border-bottom: windowtext 1pt solid; background-color: #f2f2f2; border-top-color: #f0f0f0; border-left-color: #f0f0f0; border-right: windowtext 1pt solid" class="xl77"&gt;&lt;font face="Segoe UI"&gt;Tampa, FL&lt;/font&gt;&lt;/td&gt;          &lt;td style="border-bottom: windowtext 1pt solid; background-color: #f2f2f2; border-top-color: #f0f0f0; width: 125pt; border-left-color: #f0f0f0; border-right: windowtext 1pt solid" class="xl78" width="167"&gt;&lt;a href="http://www.microsoft.com/click/services/Redirect2.ashx?CR_CC=200090652&amp;amp;CR_EAC=300039463"&gt;&lt;span style="font-family: &amp;quot;Segoe UI&amp;quot;, sans-serif; font-size: 12pt; mso-font-charset: 0"&gt;Details &amp;amp; Registration&lt;/span&gt;&lt;/a&gt;&lt;/td&gt;       &lt;/tr&gt;        &lt;tr style="height: 33.75pt; mso-yfti-irow: 6; mso-height-source: userset" height="45"&gt;         &lt;td style="border-bottom: windowtext 1pt solid; border-left: windowtext 1pt solid; background-color: transparent; border-top-color: #f0f0f0; height: 33.75pt; border-right: windowtext 1pt solid" class="xl65" height="45"&gt;&lt;font face="Segoe UI"&gt;April 19, 2012&lt;/font&gt;&lt;/td&gt;          &lt;td style="border-bottom: windowtext 1pt solid; background-color: transparent; border-top-color: #f0f0f0; border-left-color: #f0f0f0; border-right: windowtext 1pt solid" class="xl66"&gt;&lt;font face="Segoe UI"&gt;Ft. Lauderdale, FL&lt;/font&gt;&lt;/td&gt;          &lt;td style="border-bottom: windowtext 1pt solid; background-color: transparent; border-top-color: #f0f0f0; width: 125pt; border-left-color: #f0f0f0; border-right: windowtext 1pt solid" class="xl68" width="167"&gt;&lt;a href="http://www.microsoft.com/click/services/Redirect2.ashx?CR_CC=200090652&amp;amp;CR_EAC=300039465"&gt;&lt;span style="font-family: &amp;quot;Segoe UI&amp;quot;, sans-serif; font-size: 12pt; mso-font-charset: 0"&gt;Details &amp;amp; Registration&lt;/span&gt;&lt;/a&gt;&lt;/td&gt;       &lt;/tr&gt;        &lt;tr style="height: 33.75pt; mso-yfti-irow: 7; mso-height-source: userset" height="45"&gt;         &lt;td style="border-bottom: windowtext 1pt solid; border-left: windowtext 1pt solid; background-color: #f2f2f2; border-top-color: #f0f0f0; height: 33.75pt; border-right: windowtext 1pt solid" class="xl76" height="45"&gt;&lt;font face="Segoe UI"&gt;May 1, 2012&lt;/font&gt;&lt;/td&gt;          &lt;td style="border-bottom: windowtext 1pt solid; background-color: #f2f2f2; border-top-color: #f0f0f0; border-left-color: #f0f0f0; border-right: windowtext 1pt solid" class="xl77"&gt;&lt;font face="Segoe UI"&gt;Charlotte, NC&lt;/font&gt;&lt;/td&gt;          &lt;td style="border-bottom: windowtext 1pt solid; background-color: #f2f2f2; border-top-color: #f0f0f0; width: 125pt; border-left-color: #f0f0f0; border-right: windowtext 1pt solid" class="xl78" width="167"&gt;&lt;a href="http://www.microsoft.com/click/services/Redirect2.ashx?CR_CC=200090652&amp;amp;CR_EAC=300039467"&gt;&lt;span style="font-family: &amp;quot;Segoe UI&amp;quot;, sans-serif; font-size: 12pt; mso-font-charset: 0"&gt;Details &amp;amp; Registration&lt;/span&gt;&lt;/a&gt;&lt;/td&gt;       &lt;/tr&gt;        &lt;tr style="height: 33.75pt; mso-yfti-irow: 8; mso-height-source: userset" height="45"&gt;         &lt;td style="border-bottom: windowtext 1pt solid; border-left: windowtext 1pt solid; background-color: transparent; border-top-color: #f0f0f0; height: 33.75pt; border-right: windowtext 1pt solid" class="xl65" height="45"&gt;&lt;font face="Segoe UI"&gt;May 22, 2012&lt;/font&gt;&lt;/td&gt;          &lt;td style="border-bottom: windowtext 1pt solid; background-color: transparent; border-top-color: #f0f0f0; border-left-color: #f0f0f0; border-right: windowtext 1pt solid" class="xl66"&gt;&lt;font face="Segoe UI"&gt;Waltham, MA&lt;/font&gt;&lt;/td&gt;          &lt;td style="border-bottom: windowtext 1pt solid; background-color: transparent; border-top-color: #f0f0f0; width: 125pt; border-left-color: #f0f0f0; border-right: windowtext 1pt solid" class="xl68" width="167"&gt;&lt;a href="http://www.microsoft.com/click/services/Redirect2.ashx?CR_CC=200090652&amp;amp;CR_EAC=300039469"&gt;&lt;span style="font-family: &amp;quot;Segoe UI&amp;quot;, sans-serif; font-size: 12pt; mso-font-charset: 0"&gt;Details &amp;amp; Registration&lt;/span&gt;&lt;/a&gt;&lt;/td&gt;       &lt;/tr&gt;        &lt;tr style="height: 33.75pt; mso-yfti-irow: 9; mso-height-source: userset" height="45"&gt;         &lt;td style="border-bottom: windowtext 1pt solid; border-left: windowtext 1pt solid; background-color: #f2f2f2; border-top-color: #f0f0f0; height: 33.75pt; border-right: windowtext 1pt solid" class="xl76" height="45"&gt;&lt;font face="Segoe UI"&gt;May 23, 2012&lt;/font&gt;&lt;/td&gt;          &lt;td style="border-bottom: windowtext 1pt solid; background-color: #f2f2f2; border-top-color: #f0f0f0; border-left-color: #f0f0f0; border-right: windowtext 1pt solid" class="xl79"&gt;&lt;font face="Segoe UI"&gt;Atlanta, GA&lt;/font&gt;&lt;/td&gt;          &lt;td style="border-bottom: windowtext 1pt solid; background-color: #f2f2f2; border-top-color: #f0f0f0; width: 125pt; border-left-color: #f0f0f0; border-right: windowtext 1pt solid" class="xl78" width="167"&gt;&lt;a href="http://www.microsoft.com/click/services/Redirect2.ashx?CR_CC=200090652&amp;amp;CR_EAC=300039471"&gt;&lt;span style="font-family: &amp;quot;Segoe UI&amp;quot;, sans-serif; font-size: 12pt; mso-font-charset: 0"&gt;Details &amp;amp; Registration&lt;/span&gt;&lt;/a&gt;&lt;/td&gt;       &lt;/tr&gt;        &lt;tr style="height: 33.75pt; mso-yfti-irow: 10; mso-height-source: userset" height="45"&gt;         &lt;td style="border-bottom: windowtext 1pt solid; border-left: windowtext 1pt solid; background-color: transparent; border-top-color: #f0f0f0; height: 33.75pt; border-right: windowtext 1pt solid" class="xl65" height="45"&gt;&lt;font face="Segoe UI"&gt;May 23, 2012&lt;/font&gt;&lt;/td&gt;          &lt;td style="border-bottom: windowtext 1pt solid; background-color: transparent; border-top-color: #f0f0f0; border-left-color: #f0f0f0; border-right: windowtext 1pt solid" class="xl69"&gt;&lt;font face="Segoe UI"&gt;Farmington, CT&lt;/font&gt;&lt;/td&gt;          &lt;td style="border-bottom: windowtext 1pt solid; background-color: transparent; border-top-color: #f0f0f0; width: 125pt; border-left-color: #f0f0f0; border-right: windowtext 1pt solid" class="xl68" width="167"&gt;&lt;a href="http://www.microsoft.com/click/services/Redirect2.ashx?CR_CC=200090652&amp;amp;CR_EAC=300040172"&gt;&lt;span style="font-family: &amp;quot;Segoe UI&amp;quot;, sans-serif; font-size: 12pt; mso-font-charset: 0"&gt;Details &amp;amp; Registration&lt;/span&gt;&lt;/a&gt;&lt;/td&gt;       &lt;/tr&gt;        &lt;tr style="height: 33.75pt; mso-yfti-irow: 11; mso-height-source: userset; mso-yfti-lastrow: yes" height="45"&gt;         &lt;td style="border-bottom: windowtext 1pt solid; border-left: windowtext 1pt solid; background-color: #f2f2f2; border-top-color: #f0f0f0; height: 33.75pt; border-right: windowtext 1pt solid" class="xl76" height="45"&gt;&lt;font face="Segoe UI"&gt;May 24, 2012&lt;/font&gt;&lt;/td&gt;          &lt;td style="border-bottom: windowtext 1pt solid; background-color: #f2f2f2; border-top-color: #f0f0f0; border-left-color: #f0f0f0; border-right: windowtext 1pt solid" class="xl77"&gt;&lt;font face="Segoe UI"&gt;Malvern, PA&lt;/font&gt;&lt;/td&gt;          &lt;td style="border-bottom: windowtext 1pt solid; background-color: #f2f2f2; border-top-color: #f0f0f0; width: 125pt; border-left-color: #f0f0f0; border-right: windowtext 1pt solid" class="xl78" width="167"&gt;&lt;a href="http://www.microsoft.com/click/services/Redirect2.ashx?CR_CC=200090652&amp;amp;CR_EAC=300039473"&gt;&lt;span style="font-family: &amp;quot;Segoe UI&amp;quot;, sans-serif; font-size: 12pt; mso-font-charset: 0"&gt;Details &amp;amp; Registration&lt;/span&gt;&lt;/a&gt;&lt;/td&gt;       &lt;/tr&gt;     &lt;/tbody&gt;&lt;/table&gt; &lt;/p&gt;  &lt;p&gt;Register today and start thinking about the possibilities and what you’ll create!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10279416" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/glengordon/archive/tags/Windows+8/">Windows 8</category></item><item><title>PhoneGap on WP7 Tip #6: Trial Mode</title><link>http://blogs.msdn.com/b/glengordon/archive/2012/03/02/phonegap-on-wp7-tip-6-trial-mode.aspx</link><pubDate>Fri, 02 Mar 2012 18:38:57 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10276626</guid><dc:creator>GlenGordon</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/glengordon/rsscomments.aspx?WeblogPostID=10276626</wfw:commentRss><comments>http://blogs.msdn.com/b/glengordon/archive/2012/03/02/phonegap-on-wp7-tip-6-trial-mode.aspx#comments</comments><description>&lt;p&gt;When you provide users a way to evaluate your application without any money up front, your app turns into the best advertising for itself. The user can check out your application in a limited feature mode, and when you have them hooked in to the benefits, they’re more likely to spring the cash to buy it.&lt;/p&gt;  &lt;p&gt;On many platforms, this entails maintaining separate versions of your applications, both in the source code and in the marketplace. Not so with Windows Phone.&lt;/p&gt;  &lt;p&gt;The Windows Phone marketplace (and the forthcoming Windows 8 marketplace) provide you, the developer/publisher, the option of providing a trial mode for your application. When you publish your app with trial mode enabled, users will see two ways to get your app in the marketplace, like in this example with Angry Birds.&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/3056.angrybirds_5F00_marketplace_5F00_2.png"&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="angrybirds_marketplace" border="0" alt="angrybirds_marketplace" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-31-52-metablogapi/8737.angrybirds_5F00_marketplace_5F00_thumb.png" width="484" height="804" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Note that this is a single location in the marketplace. Which means it’s a single version of your application. You don’t need to maintain two different code bases!&lt;/p&gt;  &lt;p&gt;When the user installs the app using the “try” option, you can check a flag within your application whenever you want, and if the user installed it as a trial, you can limit what they can do. This trial mode limitation is completely up to you. You can allow them to play only a few levels of a game, limit them to adding 5 friends to some list, prevent them from saving an edited picture, whatever. The choice is yours.&lt;/p&gt;  &lt;p&gt;With a PhoneGap application on Windows Phone, we can take advantage of the trial mode capability very easily.&lt;/p&gt;  &lt;p&gt;First, take a look at &lt;a href="http://msdn.microsoft.com/en-us/library/hh286402(v=vs.92).aspx"&gt;this article for implementing trial mode in a Silverlight application&lt;/a&gt; (since that is what hosts a PhoneGap application). We’ll be using that as a basis for the code in this blog post.&lt;/p&gt;  &lt;p&gt;Specifically, we’ll need to create an application level variable to store the value of the trial mode flag. We do this because checking the flag from the underlying marketplace API takes a little time to do, so for our app to be most responsive, we’ll cache that value in a variable. Also note in the article there are certain times when we ask the marketplace API for that value – when the application starts and when the application resumes. The reason we check it when it resumes is that the user can switch away from the running app, buy the app, then return immediately, and we want to be ready to expose all the features of our app in their full glory when the user comes back!&lt;/p&gt;  &lt;p&gt;Open an existing PhoneGap project (or create a new PhoneGap project using the Visual Studio template as described &lt;a href="http://blogs.msdn.com/b/glengordon/archive/2011/11/16/phonegap-on-wp7-tip-1-handling-orientation.aspx"&gt;here&lt;/a&gt;). Then, follow the section of the trial mode article above article entitled “Checking for a Trial License in Your Application”. That will enable us to cache the value of the trial mode flag. It also provides a way to test it, since when you’re developing, there’s no marketplace installation yet from which to pull the setting. This testing code is contained in a compiler directive #if DEBUG. When the application is published, you should change the value in the drop down at the top of the Visual Studio window from Debug to Release, and you won’t have to remove any of the code, it will just switch to using the other section in the #if directive.&lt;/p&gt;  &lt;p&gt;Now that we have the trial mode value cached in our hosting Silverlight application, let’s access it from the code in our PhoneGap application. We’re going to use a Plugin as described in &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;my previous post about SMS messages&lt;/a&gt;. The difference here is that when we used a Plugin to send an SMS message, it was fire and forget, and in this case the Plugin must now return that trial mode flag.&lt;/p&gt;  &lt;p&gt;We’ll create the C# code first for the Plugin. Right click on the &lt;strong&gt;Plugins&lt;/strong&gt; folder in your project in Solution Explorer, and create a new class called &lt;strong&gt;Marketplace.cs&lt;/strong&gt;. In that class we’ll put the code that our Plugin is going to call. Replace all the code in that class with the following. Note the namespace is important, it ties this class to the PhoneGap Plugin plumbing.&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; System;&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.Net;&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;using&lt;/span&gt; System.Windows;&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; Marketplace : 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; checkLicense(&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;            PluginResult result = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; PluginResult(PluginResult.Status.OK, (Application.Current &lt;span style="color: #0000ff"&gt;as&lt;/span&gt; PGWP7_Trial.App).IsTrial);&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;this&lt;/span&gt;.DispatchCommandResult(result);&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;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 Plugin references our IsTrial variable created in the above article on trial mode, so it’s important to realize it won’t work without that code.&lt;/p&gt;

&lt;p&gt;Now that we have the function in the Plugin, we can invoke it from JavaScript inside our PhoneGap application. We’ll create a separate .js file to handle calling into the Plugin framework. Add a new text file in the www folder in the project, named &lt;strong&gt;marketplace.js&lt;/strong&gt;. &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; marketplace() {&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;marketplace.prototype.checkLicense = &lt;span style="color: #0000ff"&gt;function&lt;/span&gt; (callback) {&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; 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: 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(callback, &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;, &lt;span style="color: #006080"&gt;&amp;quot;Marketplace&amp;quot;&lt;/span&gt;, &lt;span style="color: #006080"&gt;&amp;quot;checkLicense&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.marketplace = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; marketplace();&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 handles the call to the C# code above and makes the Plugin available to the rest of the code in the PhoneGap project.&lt;/p&gt;

&lt;p&gt;Here’s a simple example to check the license. At the top of the index.html page, add a &amp;lt;script&amp;gt; tag referencing the markeplace.js file. Then use this code to check the license. Note that this pattern requires a callback, since that’s how the plugin model returns results. Passing the callback function name as a parameter each time it’s needed is an easy way to keep dependencies out of the marketplace.js file.&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;&amp;lt;script&amp;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;function&lt;/span&gt; checkLicense() {&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.marketplace.checkLicense(licenseCallback);&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;function&lt;/span&gt; licenseCallback(isTrial) {&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; (isTrial) {&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;          licenseDiv.innerHTML = &lt;span style="color: #006080"&gt;'Trial mode, please buy me!'&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;else&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;          licenseDiv.innerHTML = &lt;span style="color: #006080"&gt;'Thanks for buying!'&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;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;lt;/script&amp;gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;This bit of HTML will interact with that JavaScript.&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;button&lt;/span&gt; &lt;span style="color: #ff0000"&gt;onclick&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;checkLicense();&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;Check license&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;button&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;div&lt;/span&gt; &lt;span style="color: #ff0000"&gt;id&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;licenseDiv&amp;quot;&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;/div&gt;
&lt;/div&gt;

&lt;p&gt;Any time you need to check the licensing for your app, just use that pattern. In my next post, we’ll expand the marketplace Plugin with some other features. So get those apps out with trial mode and hook in your users!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10276626" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/glengordon/archive/tags/PhoneGap/">PhoneGap</category></item><item><title>Windows 8 Consumer Preview available today!</title><link>http://blogs.msdn.com/b/glengordon/archive/2012/02/29/windows-8-consumer-preview-available-today.aspx</link><pubDate>Wed, 29 Feb 2012 20:58:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10274849</guid><dc:creator>GlenGordon</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/glengordon/rsscomments.aspx?WeblogPostID=10274849</wfw:commentRss><comments>http://blogs.msdn.com/b/glengordon/archive/2012/02/29/windows-8-consumer-preview-available-today.aspx#comments</comments><description>&lt;p&gt;Today, the Windows family at Microsoft took a huge leap forward (pun intended).&lt;/p&gt;
&lt;p&gt;The consumer preview for Windows 8 is now available, and it&amp;rsquo;s one of the easiest installs of an update I&amp;rsquo;ve ever encountered. In fact, I was surprised to find out that I could actually update from last year&amp;rsquo;s developer preview directly, instead of having wipe my machine.&lt;/p&gt;
&lt;p&gt;Lots of great information about this release is available on various product team blogs, like the &lt;a title="blog post" href="http://windowsteamblog.com/windows/b/windowsexperience/archive/2012/02/29/introducing-windows-8-consumer-preview.aspx"&gt;Windows Experience team&lt;/a&gt; blog.&lt;/p&gt;
&lt;p&gt;Check out some of the reviews. Engadget has some &lt;a title="Microsoft Windows 8 Consumer Preview detailed impressions" href="http://www.engadget.com/2012/02/29/microsoft-windows-8-consumer-preview-detailed-impressions/"&gt;Microsoft Windows 8 Consumer Preview detailed impressions&lt;/a&gt;, and cnet has a &lt;a href="http://reviews.cnet.com/8301-13970_7-57386760-78/windows-8-beta-hands-on-with-microsofts-tablet-friendly-os/"&gt;nice writeup&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;What&amp;rsquo;s particularly exciting for developers is how well the Metro style interface scales. Check out &lt;a title="Microsoft Windows 8 on 82-inch touchscreen hands-on (video)" href="http://www.engadget.com/2012/02/29/microsoft-windows-8-on-82-inch-gorilla-glass-touchscreen-hands-o/"&gt;Microsoft Windows 8 on 82-inch touchscreen hands-on (video)&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Download it today from &lt;a href="http://preview.windows.com/"&gt;http://preview.windows.com/&lt;/a&gt; and get started building Metro apps!&lt;/p&gt;
&lt;p&gt;Don't forget that this consumer preview does &lt;em&gt;not&lt;/em&gt; include the developer tools. For that, head over to &lt;a href="http://www.microsoft.com/visualstudio/11/en-us"&gt;http://www.microsoft.com/visualstudio/11/en-us&lt;/a&gt; from your Windows 8 installation and grab it.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10274849" width="1" height="1"&gt;</description></item><item><title>Join the 30 to Launch challenge and build a Windows Phone application today!</title><link>http://blogs.msdn.com/b/glengordon/archive/2012/02/01/join-the-30-to-launch-challenge-and-build-a-windows-phone-application-today.aspx</link><pubDate>Wed, 01 Feb 2012 20:30:40 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10262943</guid><dc:creator>GlenGordon</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/glengordon/rsscomments.aspx?WeblogPostID=10262943</wfw:commentRss><comments>http://blogs.msdn.com/b/glengordon/archive/2012/02/01/join-the-30-to-launch-challenge-and-build-a-windows-phone-application-today.aspx#comments</comments><description>&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;</description></item><item><title>Get help with your Windows Phone apps at the Phone Garage in Birmingham–February 18</title><link>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</link><pubDate>Thu, 26 Jan 2012 20:51:05 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10260991</guid><dc:creator>GlenGordon</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/glengordon/rsscomments.aspx?WeblogPostID=10260991</wfw:commentRss><comments>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#comments</comments><description>&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;</description></item><item><title>Alabama Code Camp 9–March 10 in Troy, AL</title><link>http://blogs.msdn.com/b/glengordon/archive/2012/01/26/alabama-code-camp-9-march-10-in-troy-al.aspx</link><pubDate>Thu, 26 Jan 2012 15:20:40 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10260885</guid><dc:creator>GlenGordon</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/glengordon/rsscomments.aspx?WeblogPostID=10260885</wfw:commentRss><comments>http://blogs.msdn.com/b/glengordon/archive/2012/01/26/alabama-code-camp-9-march-10-in-troy-al.aspx#comments</comments><description>&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;</description></item><item><title>Excellent ASP.NET MVC3, HTML5 and jQuery training in Atlanta</title><link>http://blogs.msdn.com/b/glengordon/archive/2012/01/12/excellent-asp-net-mvc3-html5-and-jquery-training-in-atlanta.aspx</link><pubDate>Thu, 12 Jan 2012 16:48:44 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10256000</guid><dc:creator>GlenGordon</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/glengordon/rsscomments.aspx?WeblogPostID=10256000</wfw:commentRss><comments>http://blogs.msdn.com/b/glengordon/archive/2012/01/12/excellent-asp-net-mvc3-html5-and-jquery-training-in-atlanta.aspx#comments</comments><description>&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;</description></item><item><title>PhoneGap on WP7 Tip #5: Live Tiles and Deep Linking</title><link>http://blogs.msdn.com/b/glengordon/archive/2012/01/10/phonegap-on-wp7-tip-5-live-tiles-and-deep-linking.aspx</link><pubDate>Tue, 10 Jan 2012 20:32:42 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10255273</guid><dc:creator>GlenGordon</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/glengordon/rsscomments.aspx?WeblogPostID=10255273</wfw:commentRss><comments>http://blogs.msdn.com/b/glengordon/archive/2012/01/10/phonegap-on-wp7-tip-5-live-tiles-and-deep-linking.aspx#comments</comments><description>&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;</description><category domain="http://blogs.msdn.com/b/glengordon/archive/tags/PhoneGap/">PhoneGap</category></item><item><title>PhoneGap 1.3 released, full support for Windows Phone</title><link>http://blogs.msdn.com/b/glengordon/archive/2011/12/19/phonegap-1-3-released-full-support-for-windows-phone.aspx</link><pubDate>Mon, 19 Dec 2011 21:12:36 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10249352</guid><dc:creator>GlenGordon</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/glengordon/rsscomments.aspx?WeblogPostID=10249352</wfw:commentRss><comments>http://blogs.msdn.com/b/glengordon/archive/2011/12/19/phonegap-1-3-released-full-support-for-windows-phone.aspx#comments</comments><description>&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;</description><category domain="http://blogs.msdn.com/b/glengordon/archive/tags/PhoneGap/">PhoneGap</category></item><item><title>Great Windows Azure announcements and fresh content!</title><link>http://blogs.msdn.com/b/glengordon/archive/2011/12/19/great-windows-azure-announcements-and-fresh-content.aspx</link><pubDate>Mon, 19 Dec 2011 18:33:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10249299</guid><dc:creator>GlenGordon</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/glengordon/rsscomments.aspx?WeblogPostID=10249299</wfw:commentRss><comments>http://blogs.msdn.com/b/glengordon/archive/2011/12/19/great-windows-azure-announcements-and-fresh-content.aspx#comments</comments><description>&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;</description><category domain="http://blogs.msdn.com/b/glengordon/archive/tags/Windows+Azure/">Windows Azure</category></item><item><title>PhoneGap on WP7 Tip #4: The Application Bar</title><link>http://blogs.msdn.com/b/glengordon/archive/2011/12/14/phonegap-on-wp7-tip-4-the-application-bar.aspx</link><pubDate>Wed, 14 Dec 2011 16:33:13 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10247694</guid><dc:creator>GlenGordon</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/glengordon/rsscomments.aspx?WeblogPostID=10247694</wfw:commentRss><comments>http://blogs.msdn.com/b/glengordon/archive/2011/12/14/phonegap-on-wp7-tip-4-the-application-bar.aspx#comments</comments><description>&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;</description><category domain="http://blogs.msdn.com/b/glengordon/archive/tags/PhoneGap/">PhoneGap</category></item><item><title>PhoneGap on WP7 Tip #3: Sending SMS and intro to Plugins</title><link>http://blogs.msdn.com/b/glengordon/archive/2011/12/02/phonegap-on-wp7-tip-3-sending-sms-and-intro-to-plugins.aspx</link><pubDate>Fri, 02 Dec 2011 18:47:27 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10243794</guid><dc:creator>GlenGordon</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/glengordon/rsscomments.aspx?WeblogPostID=10243794</wfw:commentRss><comments>http://blogs.msdn.com/b/glengordon/archive/2011/12/02/phonegap-on-wp7-tip-3-sending-sms-and-intro-to-plugins.aspx#comments</comments><description>&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;</description><category domain="http://blogs.msdn.com/b/glengordon/archive/tags/PhoneGap/">PhoneGap</category><category domain="http://blogs.msdn.com/b/glengordon/archive/tags/Windows+Phone+7/">Windows Phone 7</category></item><item><title>PhoneGap on WP7 Tip #2: Script interaction</title><link>http://blogs.msdn.com/b/glengordon/archive/2011/11/21/phonegap-on-wp7-tip-2-script-interaction.aspx</link><pubDate>Tue, 22 Nov 2011 03:42:09 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10239411</guid><dc:creator>GlenGordon</dc:creator><slash:comments>3</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/glengordon/rsscomments.aspx?WeblogPostID=10239411</wfw:commentRss><comments>http://blogs.msdn.com/b/glengordon/archive/2011/11/21/phonegap-on-wp7-tip-2-script-interaction.aspx#comments</comments><description>&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;</description><category domain="http://blogs.msdn.com/b/glengordon/archive/tags/PhoneGap/">PhoneGap</category><category domain="http://blogs.msdn.com/b/glengordon/archive/tags/Windows+Phone+7/">Windows Phone 7</category></item></channel></rss>
