Saturday, October 6, 2012

Activities in Android

Activities are basically the applications that fill the screen for user interaction, it can be the Launcher, Phone Dialer or the Facebook application. At any given instance, the Activity window show one screen at a time and if you switch between them, the previous Activity window stored in the RAM memory will be loaded or a new Activity window is loaded, this is a helpful feature because initially when loading any application all of its resources are loaded in to the RAM, like code, scripts, services, media. As can be seen, this is an Intensive Task and consumes CPU cycles and RAM memory. When an application is closed, like when you switch from
Facebook to Twitter app Instead of freeing up all those Facebook resources from RAM it will still keep them in the memory and puts the application in Stopped State this is one of the state in Android Activity life-cycle.
In Android 4.0 and later versions there is an option to either keep the Activities in the RAM or to remove them once the App is closed.
Navigation : Settings > Developer Options (turn ON if it’s OFF) > under Apps “Don’t keep activities”

This option is NOT recommended to check, as explained, if you are a heavy user of certain applications and every time the previous application is launched from the long press home or from the App Menu, it will take considerable amount of time to load them, on the other hand, if you are a light user and have a normal handset with minimal hardware resources checking this option would show significant improvement when navigating.

No comments:

Post a Comment