Android - keeping the service alive, even the parent process is killed

I am new to Android. Right now I'm just trying to give examples that include Services. In one example, a service is created as a separate background process. Using something like this

android:process=":background" 

They said that now the service will have a separate process environment and, therefore, it is separate from the one that was running. When I killed the parent process ieApplication, the service is also killed. Is this normal behavior or not? Because what I understand from this article will not be affected by the Service, as it is a different process environment. Please correct me if I am wrong. thanks in advance

UPDATE: Even I saw the same behavior if I use: remote.

+6
source share
2 answers

Just a copy from an Android document:

If the name assigned to this attribute begins with a colon (':'), a new process, private to the application, is created when necessary. If a process name begins with a lowercase character, the global process of creating that name. Global process can be other applications that reduce resource use

http://developer.android.com/guide/topics/manifest/application-element.html#proc

+1
source

Afaik, there are two types of services,

1) background: which are executed in the same process of your application.

2) Remote: if we want to make this service run in a remote process (instead of the standard one for our .apk), we can use android: process in our manifest tag to indicate one :,

we can also use other lines and then background and remote. here is the lifecycle service

+1
source

Source: https://habr.com/ru/post/909157/


All Articles