States your application passes through.
WHAT STATES EXIST, BROADLY
Not running Starting Active and in the foreground In the background Suspended Terminated
WHAT TRIGGERS TRANSITIONS
The user leaving the application A call or notification arriving The system reclaiming memory The device being rotated or reconfigured
WHY THIS MATTERS MOST
The system can terminate your application without warning, and the user expects to return where they left off.
WHAT TO SAVE
Enough state to restore the user's position and their unsaved work.
WHEN TO SAVE IT
As it changes, or when moving to the background.
WHAT NOT TO ASSUME
That you will get a chance to save on termination.
WHAT TO RELEASE ON BACKGROUNDING
Resources: large images, connections, sensors, location updates.
WHY
A backgrounded application consuming battery or data is terminated, or uninstalled by an annoyed user.
WHAT TO TEST
Rotating the device mid-task Receiving a call mid-task Returning after the application was terminated
WHAT USERS NOTICE MOST
Losing what they entered.