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 Binder.

Getting ready

To follow this recipe, create a new project in the services solution that we created earlier and name it BoundService.

How to do it...

Let's have a look at steps required to implement a bound service:

  1. Create a new class in the ...

Get Xamarin Studio for Android Programming: A C# Cookbook now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.