I answered a somewhat similar question here . This answer has a link to the presentation held by the brady sign on droidconf in Berlin. In his slides, he describes the structure that governs such things. He also offers a source for this on github .
He offers the following solution. Create a controller object that is in the custom class area of the application. The controller starts the service or a simple workflow and notifies the user interface if it receives a notification by the service that something has changed. He advises using AIDL if this is not absolutely necessary.
The android documentation also offers an example on how to start a local process.
source share