Windows Phone Development

Visual Studio 2012 RTMd

August 1, 2012 .NET, .NET Framework, All, ASP.NET, ASP.NET MVC, C#.NET, Microsoft, Microsoft SDKs, Silverlight, VB.NET, VisualStudio, VS2012, WCF, Windows, Windows Phone, Windows Phone Development, Windows Phone SDK, WPF, WWF No comments

Microsoft has announced the RTM(Release to manufacture) of Visual Studio 2012.

For MSDN Subscribers, the bits will be available for download on August 15th. Visual Studio Professional, Premium, Test Professional, and Ultimate with MSDN Subscribers can also sign up for a free, one year developer account for Windows Store today, with Windows Phone developer accounts coming soon.

Microsoft is planning an exciting launch even on September 12th visit http://visualstudiolaunch.com for more details.

Quick comparison sheet of Visual Studio 2012 editions from Microsoft (view comparison)

image

Sources:

http://channel9.msdn.com/posts/Visual-Studio-2012-RTM

http://www.microsoft.com/visualstudio/11/en-us/products/compare

http://blogs.msdn.com/b/somasegar/archive/2012/08/01/visual-studio-2012-and-net-4-5-complete.aspx

http://blogs.technet.com/b/serverandtools/archive/2012/08/01/platform-delivered-microsoft-visual-studio-2012-and-windows-server-2012-released-to-manufacturing-rtm.aspx

 

Microsoft has announced Windows Phone 8

June 21, 2012 .NET, All, Microsoft, Microsoft SDKs, VS2012, Windows, Windows Phone, Windows Phone 8, Windows Phone Development, Windows Phone SDK No comments

Yesterday Microsoft has made a major announcement few days right after the announcement of Surface Tablet.   NFC, MicroSD, dual-core support, more memory  – oomphh!!!! I am gonna love new windows phone.

Windows Phone 8 is going to be a game changer and Microsoft has revamped it to fit with modern mobile user needs.

As per Joe Belfiore’s announcement blog on Windows Phone Team blog, Windows Phone 8 is going to have the ultimate power of Windows 8. Revamped from older Windows CE kernel to Windows kernel, there would be tight integration between Windows 8 and windows phone 8.

Windows Phone 8 for Consumers:

Here are the some announced features of Windows Phone 8 extracted from Windows Phone Team blog:

 

  • Multi-core processor support: As reviewers have noted, Windows Phone runs buttery smooth on phones with a single processor. But piggybacking on the Windows core provides support for multiple cores—so we’re ready for whatever hardware makers dream up.
  • Bigger, sharper screens: Windows Phone 8 supports two new screen resolutions—1280×768 and 1280×720, opening the door to amazing new handsets with high-definition 720p displays.
  • More flexible storage: Windows Phone 8 supports removable MicroSD cards, so you can stuff your phone with extra photos, music, and whatever else is important to you, and then easily move it all onto your PC.
  • NFC wireless sharing: If you haven’t heard the term “NFC” yet, I’m betting you soon will. This emerging wireless technology lets phones share things over short distances. In Windows Phone 8, it helps make sharing photos, Office docs, and contact info easier—just tap your phone another NFC-equipped device. How cool is that?
  • Internet Explorer 10: The next version of Windows Phone comes with the same web browsing engine that’s headed for Window 8 PCs and tablets. IE10 is faster and more secure, with advanced anti-phishing features like SmartScreen Filter to block dangerous websites and malware.
  • Wallet: Windows Phone 8’s new digital Wallet feature does two great things. It can keep debit and credit cards, coupons, boarding passes, and other important info right at your fingertips. And when paired with a secure SIM from your carrier, you can also pay for things with a tap of your phone at compatible checkout counters.
  • Better maps and directions: Windows Phone 8 builds in Nokia mapping as part of the platform. Our partnership will provide more detailed maps and turn-by-turn directions in many countries, plus the ability to store maps offline on your phone so you can work with maps without a data connection.
  • Cooler apps and games: Basing Windows Phone 8 on the Windows core will unleash a new wave of amazing apps and especially games, for reasons I’ll touch on in a moment.

How about existing users with Windows Phone 7.5 (will they get an upgrade)?

NO, they will receive an update to integrate new home screen feature to existing Windows Phone 7.5, and this update would be called as “Windows Phone 7.8”

Because Windows Phone 8 is a generation shift in technology, and Windows Phone 8 cannot run on the current hardware’s of Windows Phone 7.5.

 

Windows Phone 8 for Developers

As per the announcement Developers will get the beta or preview version of new Windows Phone 8 SDK.

Windows Phone 8 for Enterprise

Windows Phone 8 will provide drive encryption, better security, remote management capability and Company Hub and apps: Companies can create their own Windows Phone 8 Hub for custom employee apps and other critical business info.

 

You need more answers? Visit the Windows Phone 8 announcement blog

http://windowsteamblog.com/windows_phone/b/windowsphone/archive/2012/06/20/announcing-windows-phone-8.aspx

Windows Phone 8: Everything you need to know (FAQ)

Videos from Windows Phone Summit Channel 9 

Windows Phone Development–Background Agents in Windows Phone

April 26, 2012 .NET, All, Codes, KnowledgeBase, Microsoft, Microsoft SDKs, Mobile-Development, Silverlight, VisualStudio, VS2010, Windows, Windows Phone, Windows Phone "Mango", Windows Phone "Tango", Windows Phone 7, Windows Phone 7.0, Windows Phone 7.5, Windows Phone Development, Windows Phone SDK No comments

Windows Phone came through long way after it’s initial release on Oct 21st 2010.  Windows Phone 7.5 update release called as “MANGO” brought lots of improvements including Multi tasking capabilities etc. With the introduction of multi-tasking ( it is not true multi tasking, but an efficient application switching which ensures that only one application will reside in memory and remaining running applications will be in deactivated stage. Since the application is not killed, it can be launched faster – that gives the capability similar to true multi tasking).

What is Background Agents?

Background agents feature allows you to run certain code in a background thread and scheduled tasks  are that runs periodically.

Scheduled Tasks and background agents allow an application to execute code in the background, even when the application is not running in the foreground. The different types of Scheduled Tasks are designed for different types of background processing scenarios and therefore have different behaviors and constraints.

Note: that Background agents are not supported in 256MB devices. Only initial 512MB devices with Windows Phone “MANGO” would be able to run background agents

 

There are types of scheduled tasks or Background Agents and they are:

1. Periodic Task Agents- Periodic task agents will run for a short period of time and does a certain predefined operations defined by you. It also have the capability to run based on certain time interval.

A typical example would be checking whether device is having network connectivity periodically or checking any mails available with mail server etc.

2. Resource Intensive Task Agents- Resource Intensive tasks agents will run for a long period if all your network connectivity(if you need some network processing while doing the task) and power and resource usage etc.

A Typical example of scenario would be your phone receiving some application data updates and additional feature set update etc.

 

Using Background Agents:

1. To start with Scheduled tasks agents are part of Microsoft.Phone.Scheduler namespace

2. Create a new Windows Phone Scheduled Task project in your Windows Phone solution

image

3. Click on “OK” and Now I created a Windows Phone Scheduled Task project called  “ScheduledTaskAgent1

and this is how the initial code generated by Visual Studio will appear

using System.Windows;
using Microsoft.Phone.Scheduler;

namespace ScheduledTaskAgent1
{
    public class ScheduledAgent : ScheduledTaskAgent
    {
        private static volatile bool _classInitialized;

        /// <remarks>
        /// ScheduledAgent constructor, initializes the UnhandledException handler
        /// </remarks>
        public ScheduledAgent()
        {
            if (!_classInitialized)
            {
                _classInitialized = true;
                // Subscribe to the managed exception handler
                Deployment.Current.Dispatcher.BeginInvoke(delegate
                {
                    Application.Current.UnhandledException += ScheduledAgent_UnhandledException;
                });
            }
        }

        /// Code to execute on Unhandled Exceptions
        private void ScheduledAgent_UnhandledException(object sender, ApplicationUnhandledExceptionEventArgs e)
        {
            if (System.Diagnostics.Debugger.IsAttached)
            {
                // An unhandled exception has occurred; break into the debugger
                System.Diagnostics.Debugger.Break();
            }
        }

        /// <summary>
        /// Agent that runs a scheduled task
        /// </summary>
        /// <param name="task">
        /// The invoked task
        /// </param>
        /// <remarks>
        /// This method is called when a periodic or resource intensive task is invoked
        /// </remarks>
        protected override void OnInvoke(ScheduledTask task)
        {
            //TODO: Add code to perform your task in background

            NotifyComplete();
        }
    }
}

Now you can see there is an OnInvoke(ScheduledTask task) method, inside that method we will define our Periodic or Resource Intensive tasks implementation.

 

4. Now it is the time for us to do our implementation.  (This sample I have taken from MSDN Reference on How to: Implement Background Agents for Windows Phone)

         a.) Scheduled Task Code Implementation (this code will send toast messages, so that you can see that when your application is running in background. )

 /// <summary>
        /// Agent that runs a scheduled task
        /// </summary>
        /// <param name="task">
        /// The invoked task
        /// </param>
        /// <remarks>
        /// This method is called when a periodic or resource intensive task is invoked
        /// </remarks>
        protected override void OnInvoke(ScheduledTask task)
        {

              //TODO: Add code to perform your task in background
              string toastMessage = "";

              // If your application uses both PeriodicTask and ResourceIntensiveTask
              // you can branch your application code here. Otherwise, you don't need to.
              if (task is PeriodicTask)
              {
                // Execute periodic task actions here.
                toastMessage = "Periodic task are running.";
              }
              else
              {
                // Execute resource-intensive task actions here.
                toastMessage = "Resource-intensive task are running.";
              }

              // Launch a toast to show that the agent is running.
              // The toast will not be shown if the foreground application is running.
              ShellToast toast = new ShellToast();
              toast.Title = "Background Agent Sample";
              toast.Content = toastMessage;
              toast.Show();

              // If debugging is enabled, launch the agent again in one minute.
            #if DEBUG_AGENT
              ScheduledActionService.LaunchForTest(task.Name, TimeSpan.FromSeconds(30));
            #endif

              // Call NotifyComplete to let the system know the agent is done working.


            NotifyComplete();
        }

     

     b.) MainPage.xaml  markup

<span style="color: blue">&lt;</span><span style="color: #a31515">phone</span><span style="color: blue">:</span><span style="color: #a31515">PhoneApplicationPage 
    </span><span style="color: red">x</span><span style="color: blue">:</span><span style="color: red">Class</span><span style="color: blue">=&quot;PhoneApp1.MainPage&quot;
    </span><span style="color: red">xmlns</span><span style="color: blue">=&quot;http://schemas.microsoft.com/winfx/2006/xaml/presentation&quot;
    </span><span style="color: red">xmlns</span><span style="color: blue">:</span><span style="color: red">x</span><span style="color: blue">=&quot;http://schemas.microsoft.com/winfx/2006/xaml&quot;
    </span><span style="color: red">xmlns</span><span style="color: blue">:</span><span style="color: red">phone</span><span style="color: blue">=&quot;clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone&quot;
    </span><span style="color: red">xmlns</span><span style="color: blue">:</span><span style="color: red">shell</span><span style="color: blue">=&quot;clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone&quot;
    </span><span style="color: red">xmlns</span><span style="color: blue">:</span><span style="color: red">d</span><span style="color: blue">=&quot;http://schemas.microsoft.com/expression/blend/2008&quot;
    </span><span style="color: red">xmlns</span><span style="color: blue">:</span><span style="color: red">mc</span><span style="color: blue">=&quot;http://schemas.openxmlformats.org/markup-compatibility/2006&quot;
    </span><span style="color: red">mc</span><span style="color: blue">:</span><span style="color: red">Ignorable</span><span style="color: blue">=&quot;d&quot; </span><span style="color: red">d</span><span style="color: blue">:</span><span style="color: red">DesignWidth</span><span style="color: blue">=&quot;480&quot; </span><span style="color: red">d</span><span style="color: blue">:</span><span style="color: red">DesignHeight</span><span style="color: blue">=&quot;768&quot;
    </span><span style="color: red">FontFamily</span><span style="color: blue">=&quot;{</span><span style="color: #a31515">StaticResource </span><span style="color: red">PhoneFontFamilyNormal</span><span style="color: blue">}&quot;
    </span><span style="color: red">FontSize</span><span style="color: blue">=&quot;{</span><span style="color: #a31515">StaticResource </span><span style="color: red">PhoneFontSizeNormal</span><span style="color: blue">}&quot;
    </span><span style="color: red">Foreground</span><span style="color: blue">=&quot;{</span><span style="color: #a31515">StaticResource </span><span style="color: red">PhoneForegroundBrush</span><span style="color: blue">}&quot;
    </span><span style="color: red">SupportedOrientations</span><span style="color: blue">=&quot;Portrait&quot; </span><span style="color: red">Orientation</span><span style="color: blue">=&quot;Portrait&quot;
    </span><span style="color: red">shell</span><span style="color: blue">:</span><span style="color: red">SystemTray.IsVisible</span><span style="color: blue">=&quot;True&quot;&gt;

    </span><span style="color: green">&lt;!--LayoutRoot is the root grid where all page content is placed--&gt;
    </span><span style="color: blue">&lt;</span><span style="color: #a31515">Grid </span><span style="color: red">x</span><span style="color: blue">:</span><span style="color: red">Name</span><span style="color: blue">=&quot;LayoutRoot&quot; </span><span style="color: red">Background</span><span style="color: blue">=&quot;Transparent&quot;&gt;
        &lt;</span><span style="color: #a31515">Grid.RowDefinitions</span><span style="color: blue">&gt;
            &lt;</span><span style="color: #a31515">RowDefinition </span><span style="color: red">Height</span><span style="color: blue">=&quot;Auto&quot;/&gt;
            &lt;</span><span style="color: #a31515">RowDefinition </span><span style="color: red">Height</span><span style="color: blue">=&quot;*&quot;/&gt;
        &lt;/</span><span style="color: #a31515">Grid.RowDefinitions</span><span style="color: blue">&gt;

        </span><span style="color: green">&lt;!--TitlePanel contains the name of the application and page title--&gt;
        </span><span style="color: blue">&lt;</span><span style="color: #a31515">StackPanel </span><span style="color: red">x</span><span style="color: blue">:</span><span style="color: red">Name</span><span style="color: blue">=&quot;TitlePanel&quot; </span><span style="color: red">Grid.Row</span><span style="color: blue">=&quot;0&quot; </span><span style="color: red">Margin</span><span style="color: blue">=&quot;12,17,0,28&quot;&gt;
            &lt;</span><span style="color: #a31515">TextBlock </span><span style="color: red">x</span><span style="color: blue">:</span><span style="color: red">Name</span><span style="color: blue">=&quot;ApplicationTitle&quot; </span><span style="color: red">Text</span><span style="color: blue">=&quot;Craziness App&quot; </span><span style="color: red">Style</span><span style="color: blue">=&quot;{</span><span style="color: #a31515">StaticResource </span><span style="color: red">PhoneTextNormalStyle</span><span style="color: blue">}&quot;/&gt;
            &lt;</span><span style="color: #a31515">TextBlock </span><span style="color: red">x</span><span style="color: blue">:</span><span style="color: red">Name</span><span style="color: blue">=&quot;PageTitle&quot; </span><span style="color: red">Text</span><span style="color: blue">=&quot;Tasks Sample&quot; </span><span style="color: red">Margin</span><span style="color: blue">=&quot;9,-7,0,0&quot; </span><span style="color: red">Style</span><span style="color: blue">=&quot;{</span><span style="color: #a31515">StaticResource </span><span style="color: red">PhoneTextTitle1Style</span><span style="color: blue">}&quot;/&gt;
        &lt;/</span><span style="color: #a31515">StackPanel</span><span style="color: blue">&gt;

        </span><span style="color: green">&lt;!--ContentPanel - place additional content here--&gt;
        </span><span style="color: blue">&lt;</span><span style="color: #a31515">Grid </span><span style="color: red">x</span><span style="color: blue">:</span><span style="color: red">Name</span><span style="color: blue">=&quot;ContentPanel&quot; </span><span style="color: red">Grid.Row</span><span style="color: blue">=&quot;1&quot; </span><span style="color: red">Margin</span><span style="color: blue">=&quot;12,0,12,0&quot;&gt;

            &lt;</span><span style="color: #a31515">StackPanel</span><span style="color: blue">&gt;
                &lt;</span><span style="color: #a31515">StackPanel  </span><span style="color: red">Orientation</span><span style="color: blue">=&quot;Vertical&quot; </span><span style="color: red">Name</span><span style="color: blue">=&quot;PeriodicStackPanel&quot; </span><span style="color: red">Margin</span><span style="color: blue">=&quot;0,0,0,40&quot;&gt;
                    &lt;</span><span style="color: #a31515">TextBlock </span><span style="color: red">Text</span><span style="color: blue">=&quot;Periodic Agent&quot; </span><span style="color: red">Style</span><span style="color: blue">=&quot;{</span><span style="color: #a31515">StaticResource </span><span style="color: red">PhoneTextTitle2Style</span><span style="color: blue">}&quot;/&gt;
                    &lt;</span><span style="color: #a31515">StackPanel </span><span style="color: red">Orientation</span><span style="color: blue">=&quot;Horizontal&quot;&gt;
                        &lt;</span><span style="color: #a31515">TextBlock </span><span style="color: red">Text</span><span style="color: blue">=&quot;name: &quot; </span><span style="color: red">Style</span><span style="color: blue">=&quot;{</span><span style="color: #a31515">StaticResource </span><span style="color: red">PhoneTextAccentStyle</span><span style="color: blue">}&quot;/&gt;
                        &lt;</span><span style="color: #a31515">TextBlock </span><span style="color: red">Text</span><span style="color: blue">=&quot;{</span><span style="color: #a31515">Binding </span><span style="color: red">Name</span><span style="color: blue">}&quot; /&gt;
                    &lt;/</span><span style="color: #a31515">StackPanel</span><span style="color: blue">&gt;
                    &lt;</span><span style="color: #a31515">StackPanel </span><span style="color: red">Orientation</span><span style="color: blue">=&quot;Horizontal&quot;&gt;
                        &lt;</span><span style="color: #a31515">TextBlock </span><span style="color: red">Text</span><span style="color: blue">=&quot;is enabled&quot; </span><span style="color: red">VerticalAlignment</span><span style="color: blue">=&quot;Center&quot;  </span><span style="color: red">Style</span><span style="color: blue">=&quot;{</span><span style="color: #a31515">StaticResource </span><span style="color: red">PhoneTextAccentStyle</span><span style="color: blue">}&quot;/&gt;
                        &lt;</span><span style="color: #a31515">CheckBox </span><span style="color: red">Name</span><span style="color: blue">=&quot;PeriodicCheckBox&quot; </span><span style="color: red">IsChecked</span><span style="color: blue">=&quot;{</span><span style="color: #a31515">Binding </span><span style="color: red">IsEnabled</span><span style="color: blue">}&quot; </span><span style="color: red">Checked</span><span style="color: blue">=&quot;PeriodicCheckBox_Checked&quot; </span><span style="color: red">Unchecked</span><span style="color: blue">=&quot;PeriodicCheckBox_Unchecked&quot;/&gt;
                    &lt;/</span><span style="color: #a31515">StackPanel</span><span style="color: blue">&gt;
                    &lt;</span><span style="color: #a31515">StackPanel </span><span style="color: red">Orientation</span><span style="color: blue">=&quot;Horizontal&quot;&gt;
                        &lt;</span><span style="color: #a31515">TextBlock </span><span style="color: red">Text</span><span style="color: blue">=&quot;is scheduled: &quot;  </span><span style="color: red">Style</span><span style="color: blue">=&quot;{</span><span style="color: #a31515">StaticResource </span><span style="color: red">PhoneTextAccentStyle</span><span style="color: blue">}&quot;/&gt;
                        &lt;</span><span style="color: #a31515">TextBlock </span><span style="color: red">Text</span><span style="color: blue">=&quot;{</span><span style="color: #a31515">Binding </span><span style="color: red">IsScheduled</span><span style="color: blue">}&quot; /&gt;
                    &lt;/</span><span style="color: #a31515">StackPanel</span><span style="color: blue">&gt;
                    &lt;</span><span style="color: #a31515">StackPanel </span><span style="color: red">Orientation</span><span style="color: blue">=&quot;Horizontal&quot;&gt;
                        &lt;</span><span style="color: #a31515">TextBlock </span><span style="color: red">Text</span><span style="color: blue">=&quot;last scheduled time: &quot;  </span><span style="color: red">Style</span><span style="color: blue">=&quot;{</span><span style="color: #a31515">StaticResource </span><span style="color: red">PhoneTextAccentStyle</span><span style="color: blue">}&quot;/&gt;
                        &lt;</span><span style="color: #a31515">TextBlock </span><span style="color: red">Text</span><span style="color: blue">=&quot;{</span><span style="color: #a31515">Binding </span><span style="color: red">LastScheduledTime</span><span style="color: blue">}&quot; /&gt;
                    &lt;/</span><span style="color: #a31515">StackPanel</span><span style="color: blue">&gt;
                    &lt;</span><span style="color: #a31515">StackPanel </span><span style="color: red">Orientation</span><span style="color: blue">=&quot;Horizontal&quot;&gt;
                        &lt;</span><span style="color: #a31515">TextBlock </span><span style="color: red">Text</span><span style="color: blue">=&quot;expiration time: &quot; </span><span style="color: red">Style</span><span style="color: blue">=&quot;{</span><span style="color: #a31515">StaticResource </span><span style="color: red">PhoneTextAccentStyle</span><span style="color: blue">}&quot;/&gt;
                        &lt;</span><span style="color: #a31515">TextBlock </span><span style="color: red">Text</span><span style="color: blue">=&quot;{</span><span style="color: #a31515">Binding </span><span style="color: red">ExpirationTime</span><span style="color: blue">}&quot; /&gt;
                    &lt;/</span><span style="color: #a31515">StackPanel</span><span style="color: blue">&gt;
                    &lt;</span><span style="color: #a31515">StackPanel </span><span style="color: red">Orientation</span><span style="color: blue">=&quot;Horizontal&quot;&gt;
                        &lt;</span><span style="color: #a31515">TextBlock </span><span style="color: red">Text</span><span style="color: blue">=&quot;last exit reason: &quot;  </span><span style="color: red">Style</span><span style="color: blue">=&quot;{</span><span style="color: #a31515">StaticResource </span><span style="color: red">PhoneTextAccentStyle</span><span style="color: blue">}&quot;/&gt;
                        &lt;</span><span style="color: #a31515">TextBlock </span><span style="color: red">Text</span><span style="color: blue">=&quot;{</span><span style="color: #a31515">Binding </span><span style="color: red">LastExitReason</span><span style="color: blue">}&quot; /&gt;
                    &lt;/</span><span style="color: #a31515">StackPanel</span><span style="color: blue">&gt;
                &lt;/</span><span style="color: #a31515">StackPanel</span><span style="color: blue">&gt;
                &lt;</span><span style="color: #a31515">StackPanel  </span><span style="color: red">Orientation</span><span style="color: blue">=&quot;Vertical&quot; </span><span style="color: red">Name</span><span style="color: blue">=&quot;ResourceIntensiveStackPanel&quot; </span><span style="color: red">Margin</span><span style="color: blue">=&quot;0,0,0,40&quot;&gt;
                    &lt;</span><span style="color: #a31515">TextBlock </span><span style="color: red">Text</span><span style="color: blue">=&quot;Resource-intensive Agent&quot; </span><span style="color: red">Style</span><span style="color: blue">=&quot;{</span><span style="color: #a31515">StaticResource </span><span style="color: red">PhoneTextTitle2Style</span><span style="color: blue">}&quot;/&gt;
                    &lt;</span><span style="color: #a31515">StackPanel </span><span style="color: red">Orientation</span><span style="color: blue">=&quot;Horizontal&quot;&gt;
                        &lt;</span><span style="color: #a31515">TextBlock </span><span style="color: red">Text</span><span style="color: blue">=&quot;name: &quot; </span><span style="color: red">Style</span><span style="color: blue">=&quot;{</span><span style="color: #a31515">StaticResource </span><span style="color: red">PhoneTextAccentStyle</span><span style="color: blue">}&quot;/&gt;
                        &lt;</span><span style="color: #a31515">TextBlock </span><span style="color: red">Text</span><span style="color: blue">=&quot;{</span><span style="color: #a31515">Binding </span><span style="color: red">Name</span><span style="color: blue">}&quot; /&gt;
                    &lt;/</span><span style="color: #a31515">StackPanel</span><span style="color: blue">&gt;
                    &lt;</span><span style="color: #a31515">StackPanel </span><span style="color: red">Orientation</span><span style="color: blue">=&quot;Horizontal&quot;&gt;
                        &lt;</span><span style="color: #a31515">TextBlock </span><span style="color: red">Text</span><span style="color: blue">=&quot;is enabled&quot; </span><span style="color: red">VerticalAlignment</span><span style="color: blue">=&quot;Center&quot;  </span><span style="color: red">Style</span><span style="color: blue">=&quot;{</span><span style="color: #a31515">StaticResource </span><span style="color: red">PhoneTextAccentStyle</span><span style="color: blue">}&quot;/&gt;
                        &lt;</span><span style="color: #a31515">CheckBox </span><span style="color: red">Name</span><span style="color: blue">=&quot;ResourceIntensiveCheckBox&quot; </span><span style="color: red">IsChecked</span><span style="color: blue">=&quot;{</span><span style="color: #a31515">Binding </span><span style="color: red">IsEnabled</span><span style="color: blue">}&quot; </span><span style="color: red">Checked</span><span style="color: blue">=&quot;ResourceIntensiveCheckBox_Checked&quot; </span><span style="color: red">Unchecked</span><span style="color: blue">=&quot;ResourceIntensiveCheckBox_Unchecked&quot;/&gt;
                    &lt;/</span><span style="color: #a31515">StackPanel</span><span style="color: blue">&gt;
                    &lt;</span><span style="color: #a31515">StackPanel </span><span style="color: red">Orientation</span><span style="color: blue">=&quot;Horizontal&quot;&gt;
                        &lt;</span><span style="color: #a31515">TextBlock </span><span style="color: red">Text</span><span style="color: blue">=&quot;is scheduled: &quot;  </span><span style="color: red">Style</span><span style="color: blue">=&quot;{</span><span style="color: #a31515">StaticResource </span><span style="color: red">PhoneTextAccentStyle</span><span style="color: blue">}&quot;/&gt;
                        &lt;</span><span style="color: #a31515">TextBlock </span><span style="color: red">Text</span><span style="color: blue">=&quot;{</span><span style="color: #a31515">Binding </span><span style="color: red">IsScheduled</span><span style="color: blue">}&quot; /&gt;
                    &lt;/</span><span style="color: #a31515">StackPanel</span><span style="color: blue">&gt;
                    &lt;</span><span style="color: #a31515">StackPanel </span><span style="color: red">Orientation</span><span style="color: blue">=&quot;Horizontal&quot;&gt;
                        &lt;</span><span style="color: #a31515">TextBlock </span><span style="color: red">Text</span><span style="color: blue">=&quot;last scheduled time: &quot;  </span><span style="color: red">Style</span><span style="color: blue">=&quot;{</span><span style="color: #a31515">StaticResource </span><span style="color: red">PhoneTextAccentStyle</span><span style="color: blue">}&quot;/&gt;
                        &lt;</span><span style="color: #a31515">TextBlock </span><span style="color: red">Text</span><span style="color: blue">=&quot;{</span><span style="color: #a31515">Binding </span><span style="color: red">LastScheduledTime</span><span style="color: blue">}&quot; /&gt;
                    &lt;/</span><span style="color: #a31515">StackPanel</span><span style="color: blue">&gt;
                    &lt;</span><span style="color: #a31515">StackPanel </span><span style="color: red">Orientation</span><span style="color: blue">=&quot;Horizontal&quot;&gt;
                        &lt;</span><span style="color: #a31515">TextBlock </span><span style="color: red">Text</span><span style="color: blue">=&quot;expiration time: &quot; </span><span style="color: red">Style</span><span style="color: blue">=&quot;{</span><span style="color: #a31515">StaticResource </span><span style="color: red">PhoneTextAccentStyle</span><span style="color: blue">}&quot;/&gt;
                        &lt;</span><span style="color: #a31515">TextBlock </span><span style="color: red">Text</span><span style="color: blue">=&quot;{</span><span style="color: #a31515">Binding </span><span style="color: red">ExpirationTime</span><span style="color: blue">}&quot; /&gt;
                    &lt;/</span><span style="color: #a31515">StackPanel</span><span style="color: blue">&gt;
                    &lt;</span><span style="color: #a31515">StackPanel </span><span style="color: red">Orientation</span><span style="color: blue">=&quot;Horizontal&quot;&gt;
                        &lt;</span><span style="color: #a31515">TextBlock </span><span style="color: red">Text</span><span style="color: blue">=&quot;last exit reason: &quot;  </span><span style="color: red">Style</span><span style="color: blue">=&quot;{</span><span style="color: #a31515">StaticResource </span><span style="color: red">PhoneTextAccentStyle</span><span style="color: blue">}&quot;/&gt;
                        &lt;</span><span style="color: #a31515">TextBlock </span><span style="color: red">Text</span><span style="color: blue">=&quot;{</span><span style="color: #a31515">Binding </span><span style="color: red">LastExitReason</span><span style="color: blue">}&quot; /&gt;
                    &lt;/</span><span style="color: #a31515">StackPanel</span><span style="color: blue">&gt;
                &lt;/</span><span style="color: #a31515">StackPanel</span><span style="color: blue">&gt;
            &lt;/</span><span style="color: #a31515">StackPanel</span><span style="color: blue">&gt;


        &lt;/</span><span style="color: #a31515">Grid</span><span style="color: blue">&gt;
    &lt;/</span><span style="color: #a31515">Grid</span><span style="color: blue">&gt;
 
    </span><span style="color: green">&lt;!--Sample code showing usage of ApplicationBar--&gt;
    &lt;!--&lt;phone:PhoneApplicationPage.ApplicationBar&gt;
        &lt;shell:ApplicationBar IsVisible=&quot;True&quot; IsMenuEnabled=&quot;True&quot;&gt;
            &lt;shell:ApplicationBarIconButton IconUri=&quot;/Images/appbar_button1.png&quot; Text=&quot;Button 1&quot;/&gt;
            &lt;shell:ApplicationBarIconButton IconUri=&quot;/Images/appbar_button2.png&quot; Text=&quot;Button 2&quot;/&gt;
            &lt;shell:ApplicationBar.MenuItems&gt;
                &lt;shell:ApplicationBarMenuItem Text=&quot;MenuItem 1&quot;/&gt;
                &lt;shell:ApplicationBarMenuItem Text=&quot;MenuItem 2&quot;/&gt;
            &lt;/shell:ApplicationBar.MenuItems&gt;
        &lt;/shell:ApplicationBar&gt;
    &lt;/phone:PhoneApplicationPage.ApplicationBar&gt;--&gt;

</span><span style="color: blue">&lt;/</span><span style="color: #a31515">phone</span><span style="color: blue">:</span><span style="color: #a31515">PhoneApplicationPage</span><span style="color: blue">&gt;
</span>

and this is how my application screen would look like

image

   c. MainPage.xaml.cs implementation

using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Microsoft.Phone.Controls;
using Microsoft.Phone.Scheduler;
using Microsoft.Phone.Tasks;

namespace PhoneApp1
{
    public partial class MainPage : PhoneApplicationPage
    {
        PeriodicTask periodicTask;
        ResourceIntensiveTask resourceIntensiveTask;

        string periodicTaskName = "PeriodicAgent";
        string resourceIntensiveTaskName = "ResourceIntensiveAgent";
        public bool agentsAreEnabled = true;
        bool ignoreCheckBoxEvents = false;

        // Constructor
        public MainPage()
        {
            InitializeComponent();
            this.Loaded += new RoutedEventHandler(MainPage_Loaded);
        }

        void MainPage_Loaded(object sender, RoutedEventArgs e)
        {
            
         
        }



        private void StartPeriodicAgent()
        {
            // Variable for tracking enabled status of background agents for this app.
            agentsAreEnabled = true;

            // Obtain a reference to the period task, if one exists
            periodicTask = ScheduledActionService.Find(periodicTaskName) as PeriodicTask;

            // If the task already exists and background agents are enabled for the
            // application, you must remove the task and then add it again to update 
            // the schedule
            if (periodicTask != null)
            {
                RemoveAgent(periodicTaskName);
            }

            periodicTask = new PeriodicTask(periodicTaskName);

            // The description is required for periodic agents. This is the string that the user
            // will see in the background services Settings page on the device.
            periodicTask.Description = "This demonstrates a periodic task.";

            // Place the call to Add in a try block in case the user has disabled agents.
            try
            {
                ScheduledActionService.Add(periodicTask);
                PeriodicStackPanel.DataContext = periodicTask;

                // If debugging is enabled, use LaunchForTest to launch the agent in 30 seconds.
             //   #if(DEBUG_AGENT)
                    ScheduledActionService.LaunchForTest(periodicTaskName, TimeSpan.FromSeconds(30));
                //#endif
            }
            catch (InvalidOperationException exception)
            {
                if (exception.Message.Contains("BNS Error: The action is disabled"))
                {
                    MessageBox.Show("Background agents for this application have been disabled by the user.");
                    agentsAreEnabled = false;
                    PeriodicCheckBox.IsChecked = false;
                }

                if (exception.Message.Contains("BNS Error: The maximum number of ScheduledActions of this type have already been added."))
                {
                    // No user action required. The system prompts the user when the hard limit of periodic tasks has been reached.

                }
                PeriodicCheckBox.IsChecked = false;
            }
            catch (SchedulerServiceException)
            {
                // No user action required.
                PeriodicCheckBox.IsChecked = false;
            }
        }


        private void StartResourceIntensiveAgent()
        {
            // Variable for tracking enabled status of background agents for this app.
            agentsAreEnabled = true;

            resourceIntensiveTask = ScheduledActionService.Find(resourceIntensiveTaskName) as ResourceIntensiveTask;

            // If the task already exists and background agents are enabled for the
            // application, you must remove the task and then add it again to update 
            // the schedule.
            if (resourceIntensiveTask != null)
            {
                RemoveAgent(resourceIntensiveTaskName);
            }

            resourceIntensiveTask = new ResourceIntensiveTask(resourceIntensiveTaskName);

            // The description is required for periodic agents. This is the string that the user
            // will see in the background services Settings page on the device.
            resourceIntensiveTask.Description = "This demonstrates a resource-intensive task.";

            // Place the call to Add in a try block in case the user has disabled agents.
            try
            {
                ScheduledActionService.Add(resourceIntensiveTask);
                ResourceIntensiveStackPanel.DataContext = resourceIntensiveTask;

                // If debugging is enabled, use LaunchForTest to launch the agent in one minute.
                //#if(DEBUG_AGENT)
                    ScheduledActionService.LaunchForTest(resourceIntensiveTaskName, TimeSpan.FromSeconds(60));
                //#endif
            }
            catch (InvalidOperationException exception)
            {
                if (exception.Message.Contains("BNS Error: The action is disabled"))
                {
                    MessageBox.Show("Background agents for this application have been disabled by the user.");
                    agentsAreEnabled = false;

                }
                ResourceIntensiveCheckBox.IsChecked = false;
            }
            catch (SchedulerServiceException)
            {
                // No user action required.
                ResourceIntensiveCheckBox.IsChecked = false;
            }


        }

        private void PeriodicCheckBox_Checked(object sender, RoutedEventArgs e)
        {
            if (ignoreCheckBoxEvents)
                return;
            StartPeriodicAgent();
        }
        private void PeriodicCheckBox_Unchecked(object sender, RoutedEventArgs e)
        {
            if (ignoreCheckBoxEvents)
                return;
            RemoveAgent(periodicTaskName);
        }
        private void ResourceIntensiveCheckBox_Checked(object sender, RoutedEventArgs e)
        {
            if (ignoreCheckBoxEvents)
                return;
            StartResourceIntensiveAgent();
        }
        private void ResourceIntensiveCheckBox_Unchecked(object sender, RoutedEventArgs e)
        {
            if (ignoreCheckBoxEvents)
                return;
            RemoveAgent(resourceIntensiveTaskName);
        }


        protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
        {
            ignoreCheckBoxEvents = true;

            periodicTask = ScheduledActionService.Find(periodicTaskName) as PeriodicTask;

            if (periodicTask != null)
            {
                PeriodicStackPanel.DataContext = periodicTask;
            }

            resourceIntensiveTask = ScheduledActionService.Find(resourceIntensiveTaskName) as ResourceIntensiveTask;
            if (resourceIntensiveTask != null)
            {
                ResourceIntensiveStackPanel.DataContext = resourceIntensiveTask;
            }

            ignoreCheckBoxEvents = false;

        }




        private void RemoveAgent(string name)
        {
            try
            {
                ScheduledActionService.Remove(name);
            }
            catch (Exception)
            {
            }
        }

    }
}

             

 d.) and Hit “F5” Smile

 

and below are some screen shots for reference.

  1. App is running and Periodic Agent is enabled to run on every 30 seconds.

image

now after 30 seconds scheduled tasks run and called the Scheduled Task implementation

image

 

and can see that last run status is updated and last run reason is completed.

image

 

Apologies for the Poor formatting.

Hope the code is self explanatory and since the Post is so big after the code blocks and screen shots, I am not including much explanations of this sample. You can read MSDN Reference on How to: Implement Background Agents for Windows Phone, which includes clear cut explanation of the above sample.

References:

Background Agents Overview for Windows Phone

How to: Implement Background Agents for Windows Phone

Windows Phone Development–Developing for 256 MB (low profile) Windows Phone Devices

April 25, 2012 .NET, All, Microsoft, Microsoft SDKs, Mobile-Development, Silverlight, VisualStudio, VS2010, Windows Phone, Windows Phone "Mango", Windows Phone "Tango", Windows Phone 7, Windows Phone 7.0, Windows Phone 7.5, Windows Phone Development, Windows Phone SDK No comments

Microsoft has announced that upcoming Windows Phone 7.5 Refresh code named as “Tango” will have low profile 256 MB devices which would make Microsoft’s entry in to mobile market by delivering low cost Windows Phone devices.

All existing Windows Phone devices are having 512 MB RAM, considering the mid-range or low entry market Microsoft has included the support for 256MB Windows Phone devices.

Feature Limitations on Windows Phone – 256MB Devices

You can use most features offered in Windows Phone OS 7.1 on 256-MB devices with no performance issues. However, generic background agents are not supported on 256-MB devices, and a few additional features should be used with care so you do not exceed the memory limit of the application.

 

Additionally Microsoft has released the restrictions/limitations for 256MB “Tango” (Windows Phone 7.5 “REFRESH”) devices.

  • Windows Phone Marketplace app restrictions – Some processor-intensive apps have memory requirements, and won’t work on phones with 256 MB of RAM. You can check how much memory you have on your phone by tapping Settings > About.
  • Podcast Subscriptions and Video Podcasts – You won’t be able to manage podcast subscriptions on your phone or watch video podcasts if your phone has 256 MB of RAM.
  • Local Scout – You won’t be able to use Local Scout if your phone has only 256 MB of RAM.
  • Fast app switching – This feature will work if your phone has 256 MB of RAM. But applications that use over 90MB will be killed immediately after deactivation.
  • SkyDrive automatic photo upload – You won’t be able to upload pictures automatically to SkyDrive if your phone has only 256 MB of RAM.
  • HD video playback – You won’t be able to play video compressed with some of the listed codecs if your phone has 256 MB of RAM.
  • Background agents – To free up RAM for the foreground on 256MB devices, generic background agents (Periodic Tasks/ResourceIntensiveTasks) are disabled.

 

Tools Required for Development

You would need Windows Phone SDK 7.1.1 Update which includes the support for 256 MB windows Phone device application development. (Of course this is an update which needs to be installed after installing Windows Phone SDK 7.1 )

Windows Phone SDK 7.1.1 Update includes a new 256 MB emulator apart from usual 512 MB emulator and you can toggle between these emulators using the devices menu on Visual Studio 2010.

Windows Phone SDK 7.1.1 Update also includes the support for Windows 8. Now you can install and develop Windows Phone applications on your Windows 8(currently Consumer Preview / BETA).

 

Things to consider when developing for Windows Phone – 256MB Devices

1. Make you application to stay within Application Memory Limits of the Device

Windows Phone – 256MB will have a an Application Memory limit of 90MB, any application that use over 90MB will be immediately killed after deactivation. That means the application will not remain in resident ready to wake up. The application will be killed by OS to save up resources.

While doing development you can check Application Memory Limit on a device using ApplicationWorkingSetLimit parameter for DeviceExtendedProperties.GetValue(string) method.

For example:

 <span class="kwrd">long</span> result = 
    (<span class="kwrd">long</span>)DeviceExtendedProperties.GetValue(<span class="str">&quot;ApplicationWorkingSetLimit&quot;</span>);

 

2. Avoid Generic Background Agents

You would need to have special care when using generic background tasks such as

  • Resource-intensive tasks
  • Periodic tasks

You will have to efficiently manage the resource intensive tasks and empty the task after the completion.

When you try to add one of these background agents in your application using the Add(ScheduledAction) method and passing a PeriodicTask or ResourceIntensiveTask, either on a 256-MB device or on the 256-MB emulator, an InvalidOperationException exception occurs, which indicates that the maximum number of background agents for the device has been reached. (MSDN)

3. Detect the memory limit and change application behavior

If you use a background agent in your application, and you want your application to run on all types of devices, you should check the working memory of the device and not use the background agent on a 256-MB device.

See How to: Disable Features of an Application for a 256-MB Device. (MSDN)

4. Reduce Graphics and Audio Memory Use

When you develop applications and games to run on 256-MB devices, you should be careful about how you use graphics in the game or application. Graphics and audio memory often are not pageable. Too many audio or image resources, textures, and animations can exceed the memory limits of a 256-MB device.

 

5. Consider performance optimization and reduce the application memory usage to maximum optimal

So that the OS will not have to kill your application even if it is deactivated or in dormant stage.

  • Try using the respective launchers and choosers for any purpose relating to it.
  • Avoid having heavy graphics intensive animations.
  • Handle device orientation changes gracefully

 

Restricting our application not installable on 256MB Devices

If your application is resource intensive and you are sure that this application will not work on 256MB devices, you can opt out of getting it installed on 256MB devices.

There is an option called “Requirements” available in WMAppManifest.xml file under “Capabilities” section. and you just have to set attribute value “ID_REQ_MEMORY_90” to the Requirements element .

For example:

&lt;/Capabilities&gt;
&lt;Requirements&gt;
      &lt;Requirement Name=<span class="str">&quot;ID_REQ_MEMORY_90&quot;</span> /&gt;
&lt;/Requirements&gt;

This option will restrict the application getting installed from Windows Phone market place. But still as a developer you can deploy the application to 256 MB Emulator and developer devices.

 

That’s a quick gathering of information from what I learned from MSDN, we need to consider all these aspects when we are programming for an application that will support on all the Windows Phone devices. I hope you gained some knowledge out of this post.  If you need further details, you can refer MSDN: Developing for 256-MB Devices, which is my primary reference source of information as well.

References:

MSDN: Developing for 256-MB Devices

MSDN – How to: Disable Features of an Application for a 256-MB Device.

Microsoft announces Windows Azure Media Services

April 18, 2012 .NET, All, Azure, Cloud Services, Media Services, Microsoft, Windows Phone, Windows Phone Development, Windows Phone SDK, Windowz Azure No comments

Microsoft announced new cloud based media services (called as Windows Azure Media Services)and guidance to better enable content providers and customers to tap into the power of cloud computing, at the National Association of Broadcasters (NAB) 2012 conference.

Windows Azure Media Services is a cloud-based PaaS solution that enables you to efficiently build and deliver media solutions to customers. It offers a bunch of ready-to-use services that enable the fast ingestion, encoding, format-conversion, storage, content protection, and streaming (both live and on-demand) of video. It also integrates and exposes services provided by industry leading partners – enabling an incredibly deep media stack of functionality that you can leverage.

The Windows Azure Media Services ecosystem features several media partners that integrate their technologies for customers to use in their own media solutions. These include high-speed transfers from Aspera; content encoding from Digital Rapids, ATEME and Dolby Laboratories; content security from BuyDRM and Civolution; and video-on-demand streaming from Wowza Media Systems. In addition, Windows Azure Media Services enables full-service media companies such as iStreamPlanet Co. and Movideo Pty. Ltd. to host and offer complete workflow solutions to customers.

Windows Azure Media Services will also support an entire ecosystem of connected devices. With support for Microsoft Smooth Streaming, HTTP Live Streaming and Flash media formats, Windows Azure Media Services will enable customers to reach almost any connected device, from Xbox 360, Windows Phone and Windows-based PCs to non-Microsoft platforms such as smart TVs, set-top boxes, MacOS, iOS and Android.

For more – read the announcement by Scott Guthrie from Microsoft 

http://weblogs.asp.net/scottgu/archive/2012/04/16/announcing-windows-azure-media-services.aspx

Other source of information

http://www.eweek.com/c/a/Cloud-Computing/Microsoft-Delivers-Windows-Azure-Media-Services-228566/

Windows Phone Development–Choosers and Launchers

April 17, 2012 .NET, All, C#.NET, Microsoft, Microsoft SDKs, Mobile-Development, Silverlight, Silverlight SDK & Tools, VisualStudio, VS11, VS2010, Windows, Windows 7, Windows Phone, Windows Phone "Mango", Windows Phone 7, Windows Phone 7.0, Windows Phone 7.5, Windows Phone Development, Windows Phone SDK No comments

While doing windows phone application programming you will come across some requirements such as:

a. “Selecting a contact from contact book”

b. “Open up Camera, take a photo and upload or use the photo”

c.  “Open a link in Web Browser”

How you can achieve these typical tasks?

Answer is pretty simple Windows Phone SDK provides a set of API’s or classes you can use to perform these tasks easily.

You can use Launchers and Choosers in your Windows Phone applications to enable users to perform common tasks. By using Launchers and Choosers, you help provide a consistent user experience throughout the Windows Phone platform.

1. Launchers – are certain task API’s that would invoke a built in Application on Windows Phone.

For Example: ‘opening a link on Phone Browser’. Launchers API available with Windows Phone SDK will simplifies the task of implementing such a feature from the scratch.

Some of the Launchers provided by Windows Phone SDK are:

  • Bing Maps Direction Task
  • Bing Maps View Task
  • Connection Settings Task
  • Compose Email Task
  • Market Place Details View Task
  • Market Place Hub Task
  • Market Place Review Task
  • Market Place Search Task
  • Media Player Task
  • Phone Call task
  • Search Task
  • Share a Link Task
  • Share Status
  • SMS Compose
  • Web Browser Task

[More detailed reference use MSDN on Reference on Launchers for Windows Phone]

2. Choosers – are certain task API’s that would invoke a built in Application on Windows Phone and after completing the task it would return the result through application call back methods.  When the new application appears, the user can choose to complete or cancel the task. When the user closes the new application, the calling application is usually reactivated and supplied with data and status.

 For Example: “Selecting a contact from Address book and sending a mail to it”. or “Launching camera application and taking a photo and stores it back on the application”.

Some of the Choosers provided by Windows Phone SDK are:

  • Address Chooser Task
  • Camera Capture Task
  • Email Address Chooser Task
  • Game Invite Task
  • Phone Number Choose Task
  • Photo Chooser Task
  • Save Contact Task
  • Save Email Address Task
  • Save Phone numbers task
  • Save Ringtone Task

Using Choosers and Launchers

Implementing Launchers and Choosers are pretty simple. Most of the launchers and choosers are available within namespace “Microsoft.Phone.Tasks“.

a. To use a Launcher follow the below general steps:

  1. Create an instance of the task type for the Launcher.
  2. Set any required and optional properties of the task object. These determine the behavior of the task application when it is invoked.
  3. Call the Show method of the task object.

Example:

The below example will open a Phone Web Browser with url https://google.com

  private void TestWebBrowserChooser()
        {
            WebBrowserTask webBrowserTask = new WebBrowserTask();
            webBrowserTask.Uri = new Uri("https://www.google.com");
            webBrowserTask.Show(); 
        }

b. To use a Chooser follow the below general steps:

  1. Create an instance of the task type for the Launcher.
  2. Identify the callback method to run after the user completes the task.
  3. Set any required and optional properties of the task object.
  4. Call the Show method of the task object.
  5. Implement the completed event handler to capture data and status after the user completes the task.

Example: (Below example will launch address book and when user completes selecting an address, the call back will happen and data will be passed on to your application)

 private void TestAddressBookChooser()
        {
            AddressChooserTask addressChooserTask = new AddressChooserTask();
            addressChooserTask.Completed += new EventHandler<AddressResult>(addressChooserTask_Completed);
            addressChooserTask.Show();
        }

        void addressChooserTask_Completed(object sender, AddressResult e)
        {
            Debug.WriteLine(e.Address);
            Debug.WriteLine(e.DisplayName);
            
            //throw new NotImplementedException();
        }

Pretty simple isn’t it.

But there are few important concepts you need to understand when implementing launchers and choosers.

  1. When using Launchers and Choosers, is that the calling application is either put into a dormant state or tombstoned when another application is launched.
  2. When the new task application is launched, your application is deactivated and is no longer running.
  3. Usually, your application is put into a dormant state by the operating system.
  4. After completing the task, the user can return to your application that was preserved in memory, and it resumes in the same state as before the new application was launched.
  5. However, it is also possible that your application may be terminated by the operating system. In this case, if the user returns to your application, it is a new instance, and the state of your application is not automatically restored.

Hope you enjoy this post. Will write more soon, keep reading it.

References: 

http://msdn.microsoft.com/en-us/library/ff769550(v=vs.92).aspx

http://msdn.microsoft.com/en-us/library/ff769543(v=vs.92).aspx 

http://msdn.microsoft.com/en-us/library/ff769543(v=vs.92).aspx