A Smart Developer Multitasks Without Multitasking in WP7
|clr-namespace.com has shown off a way to use tombstoning to preserve your background state and pick up where things would have been if multitasking were enabled. To put it another way, they demonstrated a stopwatch application that you can run, exit the program (which closes it and without multitasking means that it stops running) and then when the program restarts and it gives the running time as though the app was running in the background. The trick is accomplished by saving the state of the application before it closes and when the app is restarted the time from the original clock is computed. So to the end user it appears to have been running in the background the whole time. Now this doesn’t get Pandora to play in the background but time keeping apps and the like can take advantage of this. I’m curious to see what other ways devs can save states to get past the limitations of multitasking.
A demo video and source code of the app in action is located on their site.
Well, if I recall correctly, all apps will do the save state stuff. Whether they’ll be able to actually be able to do something like this remains to be seen.
Yeah, it’s up to the dev on how to save the state though. So by implemting save state with some forethought you can get results like this. It some other things, like games, save state would put you where things ended. If this app resumed where you ended then the result would be stopping at 15 seconds and then resuming two minutes later and you’re still at 15 seconds because that is what saving state generally does – pauses time.
True. It just seems like a rather niche way of making it seem like true multitasking. One thing that *might* be nice would be skipping through cut scenes, like in a game, if you’ve seen them before. If you exit out, it saves state, then uses the internal clock to calculate how far it should advance the video.
But if a dev was going to implement that, it would probably just be easier to make it so you could skip the cut scenes.