The following is the first few sections of a chapter from The Busy Coder's Guide to Android Development, plus headings for the remaining major sections, to give you an idea about the content of the chapter.

Remote Services and the Binding Pattern

Earlier in this book, we covered using services by sending commands to them to be processed. That “command pattern” is one of two primary means of interacting with a service — the binding pattern is the other. With the binding pattern, your service exposes a more traditional API, in the form of a “binder” object with methods of your choosing. On the plus side, you get a richer interface. However, it more tightly ties your activity to your service, which may cause you problems with configuration changes.

Either the command pattern or the binding pattern can be used, if desired, across process boundaries, with the client being some third-party application. In either case, you will need to export your service via an <intent-filter>. And, in the case of the binding pattern, your “binder” implementation will have some restrictions.

This chapter covers the binding pattern for local services, plus inter-process commands and binding (a.k.a., remote services).


Understanding this chapter requires that you have read the chapters on:

The Binding Pattern

The preview of this section is sleeping in.

When IPC Attacks!

The preview of this section did not survive Thanos's finger snap.

Service From Afar

The preview of this section is unavailable right now, but if you leave your name and number at the sound of the tone, it might get back to you (BEEEEEEEEEEEEP!).

Tightening Up the Security

The preview of this section is presently indisposed.

Servicing the Service

The preview of this section is out seeking fame and fortune as the Dread Pirate Roberts.

Thinking About Security

The preview of this section is [REDACTED].

The “Everlasting Service” Anti-Pattern

The preview of this section is [REDACTED].