Monday, August 31, 2009

Application Lifecycle

One of the major improvements that Android has over current Windows Mobile is the Application Lifecycle Management and you don't need to be a programmer to appreciate this. There are various methods that your application can implement to handle this management. The one I most like is OnPause(). OnPause() is called as soon your application looses its focus to the user. When this method is called it is the programmers responsibility to ensure that current state of the application is stored in case the system closes the application to free up resources.

My first experience of this as an Android User was playing media. I spend a lot of time listening to podcasts and on Windows Mobile there was nothing more annoying than being part way through a podcast only to have the system close the application because you have switched applications to read a text message. In the end I had to guess when I thought I was running out of resources and try to remember the position of the podcast. If the media player closed I had to start the podcast again and try to jump the last part I was listening to, which isn't easy in a two hour podcast. The other advantage of this is if you switch the device off then the current position is also stored. Again Windows Mobile doesn't handle this.

No comments:

Post a Comment