How can an Android application have more than one process?
If you are looking for examples, do check out hogwarts library, it shall provide you facilities for multi-processes programming in Android.
Basically there are following things you need to have in order to run a service in its "own" process.
- in AndroidManifest.xml, make sure the service's process attribute is ":remote" or something like it with a ":" prefix
- use startService() calling to bring up the service from your activity.
- use AIDL for ipc.
- Make everything transfer between processes Parcelable. (this is actually the requirement for point 3)
You can specify android:process=":remote"
in your manifest to have an activity/service run in a seperate process.
The "remote" is just the name of the remote process, and you can call it whatever you want. If you want several activities/services to run in the same process, just give it the same name.
<activity android:name=".RemoteActivity" android:label="@string/app_name" android:process=":RemoteActivityProcess"/>