Android difference between task and process

Found this area to be pretty murky even though it looks like a pretty common question.  There is no one to one relationship between tasks and process. It can be one or multiple task spread across multiple processes.

Easier way to think about it is a task is closer in resemblance to an app.

Here is what I found important

  • every apk package runs its own process
  • a task contains a collection of activities in he order in which the user interacts with them.
  • an Android process in a standard Linux process
  • tasks (AKA apps) are bags of component instances that span processes & APKs

I’m still confused but hopefully it makes a little more sense. Start with the slides from Google IO 2008: Inside the application framework and then go to the Android docs and that should make more sense.

A decent answer from stackoverlow is below. Not sure how “correct” that is

  1. Process is a low-level concept. It basically groups the threads started in your application (amongst which, the UI thread).
  2. Task is a high-level concept. It is a group of activities with a logical link between them (a use-case scenario for instance)

Roughly : your application tasks will be made of activities presented to the user, which will imply running one or more threads to do the work they are designed to do, which will run within your application process.


Google IO 2008 : Inside the android application framework

Android Docs:

This entry was posted in Android and tagged , , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s