Android - How to decide wether to run a Service in a separate Process?

Posted by pableu on Stack Overflow See other posts from Stack Overflow or by pableu
Published on 2011-01-11T14:12:51Z Indexed on 2011/01/11 14:53 UTC
Read the original article Hit count: 113

Filed under:
|
|

I am working on an Android application that collects sensor data over the course of multiple hours. For that, we have a Service that collects the Sensor Data (e.g. Acceleration, GPS, ..), does some processing and stores them remotely on a server.

Currently, this Service runs in a separate process (using android:service=":background" in the manifest). This complicates the communication between the Activities and the Service, but my predecessors created the Application this way because they thought that separating the Service from the Activities would make it more stable.

I would like some more factual reasons for the effort of running a separate process. What are the advantages? Does it really run more stable? Is the Service less likely to be killed by the OS (to free up resources) if it's in a separate process?

Our Application uses startForeground() and friends to minimize the chance of getting killed by the OS.

The Android docs are not very specific about this, the mostly state that it depends on the Application's purpose ;-)

TL;DR What are objective reasons to put a long-running Service in a separate process (in Android)?

© Stack Overflow or respective owner

Related posts about android

Related posts about process