- Is it possible to start an IntentService on a separate process? How? If so, is it mandatory to bind to it?
- Is it possible to start an IntentService on a separate process AND run it in the foreground?
- What’s the difference between
android:isolatedProcessandandroid:process? See: http://developer.android.com/guide/topics/manifest/service-element.html
Is it possible to start an IntentService on a separate process? How? If so,
Share
Yes, you can start an
IntentServicein a separate process. Simply addandroid:process=":whatever"to the manifest entry for that service.No, you don’t need to bind to it. You can communicate with it by sending it Intents using
startService()Yes (see above). To make your service run in the foreground it can call
startForeground()whenever it wants to do that. The service itself is in control of whether it runs in the foreground or background.android:processallows you to control in which process each particular component runs (by specifying the name of the process). You can group components of your application to run in separate processes (for example, all UI components in one process and all services in another). The default behaviour is that all components of an application run in the same process.android:isolatedProcessis a flag (true/false) that you can set if you want a particular service component to run in a separate process isolated from the rest of your application. The isolated process doesn’t have any of the permissions that are granted to the rest of your application. Normally, permissions are granted to an application and all components of the application have all the permissions that the application gets.android:isolatedProcessis only available starting with API level 16 (Jellybean). See http://aleksmaus.blogspot.de/2012/09/a-feature-of-android-jelly-bean.html and Advantage of introducing Isolatedprocess tag within Services in JellyBean[Android]