5 Windows Phone Fast Application Switching5.1 Execution Model5.2 Application State Management5.3 Fast Application Switching5.4 Tombstoning5.5 Application Navigation and Application Switching
Make the point that we are now going to use this diagram to go through the life cycle of an application.
This is the test that can be performed during Activation. If the test fails it means that we have to reload everything.
This is a recap, the content should have been covered in an earlier module.However, make the point that Isolated storage is available up to the capacity of the phone (at least 8GBytes or so). But it is slow to use and should only be used to persist non volatile data, for example word documents and media etc.State storage is phone memory set aside to hold the state information for dormant or tombstoned applications. This is very fast to use, but the amount available is limited, and it will be discarded if the phone is turned off.
If anyone was wondering how come our “runs every half hour” scheduled agent was running so often, this should help explain it.
This explains why, when we backed out of the application in the demonstration, Visual Studio did not show the program as running. Instead it was ready to debug the background task.
These are not set up and managed in quite the same way as agents, in that we don’t need a separate project.Instead we just create and manage transfer objects that do the work for us.
Make the point that these policies are in place to protect performance, battery life and the data allowance of our users. An application that abuses these will not be a popular one.
The MSDN example application
Make the point that for this reminder there is no recurrence. We are only boiling one egg.This can be set to daily, monthly, end of month and yearly.You can also set an expiration time when the reminder is to stop
Make the point that, as with other tasks, even though a reminder has fired it will still exist in the system.If we want to, we can find that reminder and update it, alternatively we can delete the reminder and make a new one.
Make the point that the fundamentals are the same for this technology, although the template application is much more fully worked.There is also a very comprehensive example on MSDN.
The important point to make is that a background process is not the same as a process running in the background. They are tailored for specific tasks and have constrained abilities and runtime environments.The are as easy to debug as any other application.
Windows Phone Fast App Switching, Tombstoning and Multitasking
Follow me on Twitter or the Puppy gets it @benriga
Allowed Restricted Tiles Toast Display UI Location XNA libraries Network Microphone and Camera R/W ISO store Sensors Sockets Play audio (may only use background audio APIs) Most framework APIs
Alarms Reminders • Modal • Rich information • Snooze and Dismiss • Integrates with • Sound other reminders customization • Snooze and Dismiss • No app invocation • Launch app • No stacking • Follows the phones global settings
using Microsoft.Phone.Scheduler;...eggReminder = new Reminder("Egg Timer");eggReminder.BeginTime = DateTime.Now + new TimeSpan(0, eggTime, 0);eggReminder.Content = "Egg Ready";eggReminder.RecurrenceType = RecurrenceInterval.None;eggReminder.NavigationUri = new Uri("/EggReadyPage.xaml", UriKind.Relative);ScheduledActionService.Add(eggReminder);