Logo
programming4us
programming4us
programming4us
programming4us
Home
programming4us
XP
programming4us
Windows Vista
programming4us
Windows 7
programming4us
Windows Azure
programming4us
Windows Server
programming4us
Windows Phone
 
Windows Phone

Issues in Application Architecture - Task Switching on the Phone

- Free product key for windows 10
- Free Product Key for Microsoft office 365
- Malwarebytes Premium 3.7.1 Serial Keys (LifeTime) 2019
3/13/2011 10:44:52 PM
We want our phones to be much like our other computers. We want to have a lot of applications available. We want to start up a particular application as soon as we conceive a need for it. While that application is running, we want it to be as fast as possible and have access to unlimited resources. But we want this application to coexist with other running applications because we want to be able to jump among multiple applications running on the machine.

Arbitrarily jumping among multiple running applications is somewhat impractical on the phone. It would require some kind of display showing all the currently running applications, much like the Windows taskbar. Either this taskbar would have to be constantly visible—taking valuable screen space away from the active applications—or a special button or command would need to be assigned to display the taskbar or task list.

Instead, Windows Phone 7 manages multiple active applications by implementing a stack. In a sense, this application stack extends the page stack within a single Silverlight program. You can think of the phone as an old-fashioned web browser with no tab feature and no Forward button. But it does have a Back button and it also has a Start button, which brings you to the Start screen and allows you to launch a new program.

Suppose you choose to launch a program called Analyze. You work a little with Analyze and then decide you’re finished. You press the Back button. The Analyze program is terminated and you’re back at the Start screen. That’s the simple scenario.

Later you decide you need to run Analyze again. While you’re using Analyze, you need to check something on the Web. You press the Start button to get to the Start screen and select Internet Explorer. While you’re browsing, you remember you haven’t played any games recently. You press the Start button, select Backgammon and play a little of that. While playing Backgammon, you wonder about the odds of a particular move, so you press the Start button again and run Calc. Then you feel guilty about not doing any work, so you press the Start button again and run Draft.

Draft is a Silverlight program with multiple pages. From the main page, you navigate to several other pages.

Now start pressing the Back button. You go backwards through all the pages in the page stack of the Draft, then Draft is terminated as you go back to Calc. Calc still displays the remnants of your work, and Calc is terminated as you go back to Backgammon, which shows a game in progress, and Backgammon is terminated as you go back to Internet Explorer, and again you go backwards through any Web pages you may have navigated through, and IE is terminated as you go back to Analyze, and Analyze is terminated as you go back to the Start screen. The stack is now empty.

This type of navigation is a good compromise for small devices, and it’s consistent with users’ experiences in web browsing. The stack is conceptually very simple: The Start button pushes the current application on the stack so a new application can be run; the Back button terminates the current application and pops one off the top of the stack.

However, the limited resources of the phone convinced the Windows Phone 7 developers that applications on the stack should have as minimum a footprint as possible. For this reason, an application put on the stack does not continue plugging away at work. It’s not even put into a suspended state of some sort. Something more severe than that happens. The process is actually terminated. When this terminated program comes off the stack, it is then re-executed from scratch.

This is tombstoning. The application is killed but then allowed to come back to life.

You’ve probably seen enough movies to know that re-animating a corpse can be a very scary proposition. Almost always the hideous thing that arises out of the filthy grave is not the clean and manicured loved one who went in.

The trick here is to persuade the disinterred program to look and feel much the same as when it was last alive and the user interacted with it. This process is a collaboration between you and Windows Phone 7. The phone gives you the tools (events and a place to put some data); your job is to use the tools to restore your program to a presentable state. Ideally the user should have no idea that it’s a completely new process.

For some applications, resurrection doesn’t have to be 100% successful. We all have experience with navigating among Web pages to know what’s acceptable and what’s not.

For example, suppose you visit a long Web page, and you scroll down a ways, then you navigate to another page. When you go back to the original page, it’s not too upsetting if it’s lost your place and you’re back at the top of the page.

On the other hand, if you’ve just spent 10 minutes filling out a large form, you definitely do not want to see all your work gone after another page tells you that you’ve made one tiny error.

Let’s nail down some terminology that’s consistent with some events I’ll discuss later:

  • When an application is run from the Start screen, it is said to be launched.

  • When an application is terminated as a result of the Back button, it is closed.

  • When the program is running and the user presses the Start button, the program is said to be deactivated, even though it really is quite dead. This is the tombstoned state.

  • When a program comes out of tombstoning as the user navigates back to it, it is said to be activated, even though it’s really starting up from scratch.

Other -----------------
- Issues in Application Architecture - Retaining Data across Instances
- Issues in Application Architecture - Sharing Data Among Pages
- Issues in Application Architecture - Passing Data to Pages
- Issues in Application Architecture - Basic Navigation
- Sensors and Services - Using a Map Service
- Sensors and Services - Geographic Location
- Sensors and Services : A Simple Bubble Level
- Sensors and Services : Accelerometer
- Programming Windows Phone 7 : The Intricacies of Layout - The Mighty Grid
- Programming Windows Phone 7 : The Intricacies of Layout - The Canvas and Touch
 
 
Top 10
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 2) - Wireframes,Legends
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 1) - Swimlanes
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Formatting and sizing lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Adding shapes to lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Sizing containers
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 3) - The Other Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 2) - The Data Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 1) - The Format Properties of a Control
- Microsoft Access 2010 : Form Properties and Why Should You Use Them - Working with the Properties Window
- Microsoft Visio 2013 : Using the Organization Chart Wizard with new data
 
programming4us
Windows Vista
programming4us
Windows 7
programming4us
Windows Azure
programming4us
Windows Server