Posts Tagged Bound Service in Android

Service in Android

Service is a fundamental building block in android which works in the background, that is, does its service staying in background and so the user can’t see it. Yes, you got it right , it doesn’t provide a UI. 🙂

A Service can be said to fall in any of the two forms:

1)  Started Service

2)  Bound Service

1)   Started Service: In this type of service, any component can start a service by calling startService() method. The service is stopped if the component stops it by calling stopService() method or else the service will be destroyed as the operation it is performing is completed.

2)   Bound Service: Here, the application component binds to it by calling bindService() method. Bound Service allows components to interact with the service, get results, send requests and even enable InterProcess Communication (IPC). Any number of components can bind with a service and the service persists only till the last component is destroyed.

Note: A service can behave in both the forms even, that is, the same service can be started and at the same time can allow binding too.

This means your service can be started, bound or both.

In the Next Post I’ll be discussing about Started Service with a simple example. Hope this post was useful. 🙂

Advertisements

, , , , ,

6 Comments