O'Reilly logo

Android Application Development by G. Blake Meike, Zigurd Mednieks, John Lombardo, Rick Rogers

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

Chapter 13. Inter-Process Communication

Android is designed to host a variety of applications and to maximize user choice. The platform is intended to eliminate the duplication of functionality in different applications, to allow functionality to be discovered and invoked on the fly, and to let users replace applications with others that offer similar functionality. Applications must have as few dependencies as possible, and must be able to contract out operations to other applications that may change at the user’s discretion.

Inter-process communication (IPC) is thus the basis of key features of the Android programming model. The techniques we’ll look at in this chapter are:

Intents

These enable an application to select an Activity based on the action you want to invoke and the data on which they operate. In other words, you don’t need a hardcoded path to an application to use its functions and exchange data with it. Data can be passed in both directions using Intent objects, and this enables a convenient, high-level system of inter-process communication.

Remote methods

This feature resembles the remote procedure calls (RPCs) offered by other systems: it makes APIs accessible remotely. Remote objects allow you to make method calls that look “local” but are executed in another process. They involve the use of Android’s interface definition language (AIDL).

In this chapter, we will see how these features work and how they can be used in applications.

Android applications could avoid inter-process ...

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