Implementing a bound service
Bound services are services that allow users to bind themselves to them and ask for information. The examples of bound services can be seen in the location, and sensor services are natively run on modern Android phones. The principal addition of the bound service in comparison to the started service is its ability to accept clients' requests. The clients bind themselves to services using an
IBinder instance. In this recipe, we will see how to implement a bound service and its
To follow this recipe, create a new project in the services solution that we created earlier and name it
How to do it...
Let's have a look at steps required to implement a bound service:
- Create a new class in the ...