Am very new to Android development, Am totally confused about the following cases please help me.
I have read that each android application is a separate linux process
By default each android application is a single linux process
However we can start a separate process in an application for example:
We can run a service as separate process
And each process run in its own VM
If an application named "test" starts 2 processes servicePr1 and servicePr2 then how it will encapsulate to the application("test")
If we start two process each of them has separate VM? if So Will there is 3 VM including application ? How these all encapsulate to an application?
If we close the "test" will these two process servicePr1 and servicePr2 remains in the memory as separate process ?
Will these exist in the taskmanager ?
Encapsulation, i mean
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.so.test" android:versionCode="1" android:versionName="1.0">
<uses-sdk android:minSdkVersion="8" />
<application android:icon="@drawable/icon" android:label="@string/app_name"
android:process="com.so.p1">
<activity android:name=".Activity1">
</activity>
<activity android:name=".Activity2" android:process="com.so.p2">
</activity>
<activity android:name=".Activity3" android:process="com.so.p3">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
Here 3 process are started from one application
Activity1 runs in com.so.p1 process
Activity2 runs in com.so.p2 process
Activity3 runs in com.so.p3 process
I read that each android process is run on separate VM.
When an application "test" started will there is four android process with four VM with same UID?
If these 4 process run in separate VM how it can be said that it is an application(4 individual process)
Will these 4 process communicate with each other via IPC ?
While we quit the application what will happens to these processes ? will three process remains in memory.