Changes

Jump to: navigation, search

An Overview of Android Started and Bound Services

No change in size, 19:33, 30 July 2012
no edit summary
Unless a service is specifically configured to be private (once again via a setting in the manifest file), that service can be started by other components on the same Android device. This is achieved using the Intent mechanism in the same way that one activity can launch another as outlined in preceding chapters.
Started services are launched via a call to the startService() method, passing through as an argument an Intent object identifying the service to be started. When a started service has completed its tasks, it should stop itself via a call to stopSelf(). Alternatively, a running service may be stopped by another component via a call to the stopService() method, passing through as an argument the mathcing matching Intent for the service to be stopped.
Services are given a high priority by the Android system and are typically amongst the last to be terminated in order to free up resources.

Navigation menu