O'Reilly logo

Xamarin Studio for Android Programming: A C# Cookbook by Mathieu Nayrolles

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required