patrick wrote:
> I am a little confused about the difference between services and
> processes in Android. From what I understood:
>  - each package may run as one process

At minimum. A package might have more than one process, though that is 
discouraged.

>  - therefore an activity is a process

No, because a package may have more than one activity.

>  - a service runs in the main thread of an activity (therefore it
> needs to run in the same process)

If it is a local service, yes. Or, in your AndroidManifest.xml file, you 
could specify that the service is to run in another process.

>  - but from what I know a service uses another address space than the
> hosting activity

A local service shares the address space with anything else in that 
process, including, possibly, one or more activities.

>  - because I don't know of another way in Linux to create a new
> virtual memory space than by using a new process I assume, that a
> service is actually a new process

Only if you set it up that way in AndroidManifest.xml. And, again, this 
is discouraged.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com

Android Training on the Ranch! -- Mar 16-20, 2009
http://www.bignerdranch.com/schedule.shtml

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to