Wednesday, May 05, 2010

Android programming - Application lifecycle (Video)

This is the second video in the series of videos provided by Google on Android programming.

00:00 - Introduction
01:00 - How Android integrates apps written by different authors.
07:50 - Conclusion (Ends at 08:16)

This video walks us through a hypothetical use case, where a user opens their email, reads a message which contains a link to some location. The user then clicks on the link, opens the browser and views the location on Google Maps.

While engaging in these activities, the user starts various applications (processes) and also navigates back and forth among them. The video explains how Android manages resources and the application stack so the user can navigate across their apps seamlessly.

My Takeaway
From the video it seems like Android supports a maximum of 4 running processes. One of those processes is the System process, so a user can have at most 3 applications running simultaneously. However, this does not mean that a user cannot open more applications. When the user opens the 4th application, Android will automatically terminate an application, and will also revive it in a known state if the user were to go to it again.

Ram pointed out that "4 running processes" is purely a number they used in this example. He is absolutely correct. 4 is just an example (perhaps they assumed 64 MB RAM on the phone...). The real number depends on the amount of memory (RAM) available on the phone.


Ram said...

Hey Parag,
I think the 4 applications are just an example and I guess you can lot more applications.

Parag said...

Hi Ram,

I checked out a couple other videos. I think the number (4) is dependent on the amount of memory available on the phone.

I think in this example they assumed 64 MB of RAM, in which case about 20 MB is available for applications. I believe this supports at most 4 apps. I am not totally sure of these numbers, but that's the impression I got in another video.