Suspending, Terminating, and Resuming an App

When you are building a Windows Store app, you need to maintain the illusion that the app is always running even when the user might be switching compulsively among multiple open apps. Normally, you do not explicitly close a Windows Store app—instead, you just switch to a new one.

If you switch from one app to another, Windows will suspend the app but keep the app in memory. If memory resources become low because of other running apps, Windows will quietly terminate the app in the background.

From the perspective of a user, an app should behave in the same way regardless of whether the app was suspended or terminated. You expect the app to be in the same state when you switch back to it—even if you ...

Get Windows® 8.1 Apps with HTML5 and JavaScript Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.