Chapter 5

Intents and Broadcast Receivers

What's in this Chapter?

Introducing Intents

Starting Activities, sub-Activities, and Services using implicit and explicit Intents

Using Linkify

Broadcasting events using Broadcast Intents

Using Pending Intents

An introduction to Intent Filters and Broadcast Receivers

Extending application functionality using Intent Filters

Listening for Broadcast Intents

Monitoring device state changes

Managing manifest Receivers at run time

This chapter looks at Intents—probably the most unique and important concept in Android development. You'll learn how to use Intents to broadcast data within and between applications and how to listen for them to detect changes in the system state.

You'll also learn how to define implicit and explicit Intents to start Activities or Services using late runtime binding. Using implicit Intents, you'll learn how to request that an action be performed on a piece of data, enabling Android to determine which application components can best service that request.

Broadcast Intents are used to announce events systemwide. You'll learn how to transmit these broadcasts and receive them using Broadcast Receivers.

Introducing Intents

Intents are used as a message-passing mechanism that works both within your application and between applications. You can use Intents to do the following:

  • Explicitly start a particular Service or Activity using its class name
  • Start an Activity or Service to perform an action with (or on) a particular ...

Get Professional Android 4 Application Development, 3rd Edition now with the O’Reilly learning platform.

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