Android Programming with Intents

Virtually all interactivity between Android components occurs through a special messaging concept known as intents. In this course you will learn how to work effectively with and capitalize on the many capabilities of the Android platform provided through intents.
Course info
Rating
(196)
Level
Intermediate
Updated
Nov 15, 2011
Duration
4h 14m
Table of contents
Description
Course info
Rating
(196)
Level
Intermediate
Updated
Nov 15, 2011
Duration
4h 14m
Description

Three of the core components of an application - activities, services, and broadcast receivers - are activated through messages, called intents. Intent messaging is a facility for late run-time binding between components in the same or different applications. In this course you will learn how to work effectively with and capitalize on the many capabilities of the Android platform provided through intents.

About the author
About the author

Jim Wilson is president of JW Hedgehog, Inc., a consulting firm specializing in solutions for the Android, iOS, and Microsoft platforms. Jim has over 30 years of software engineering experience, with the past 15 years heavily focused on creating mobile device and location-based solutions.

More from the author
More courses by Jim Wilson
Section Introduction Transcripts
Section Introduction Transcripts

Component activation with intents
Welcome to this module on Android component activation with intents. My name is Jim Wilson. In this module, we're going to take a look at the role that intents and intent filters play in component activation on the Android platform. We're going to start out by looking at the component activation basics. What are the fundamental concepts involved when working with intents and using intents to activate components? We're going to take a look at implicit intents and intent filters. And they're the kind of real power of intents. We'll talk about the details of what that means. What ultimately allows us to take advantage of these generic capabilities of the Android platform to specify desired behaviors and have the platform resolve those behaviors and then ultimately components on our behalf to provide these behaviors. Now, as we talked about in an earlier module, we know that intents have multiple parts to them. One of those parts is the action part. So we're going to take a look at the intent action and what the action tests mean, and how we use those to achieve component activation. The other two parts of the intent that are important in component activation are categories and the data tests. Those tests are more complicated and a little bit more involved than the action tests. So we're going to go look at those and see what role they play in terms of resolving to a component and then ultimately activating a component. Then we're going to finish it up by getting a closer look at intent resolution. We're going to take a look at the process that's involved with matching intents to intent filters and how we actually see the process the platform is following. Basically, it gives us an ability to kind of debug the intent resolution process so we can see what components the platform was using or at least evaluating or considering to resolve a particular intent. And then ultimately how it shows a particular component that it did choose to activate.

Delegation and Callbacks through PendingIntents
Welcome to this module on delegation and call backs with pending intents. My name is Jim Wilson. In this module, we're going to look at how we use pending intents to delegate capabilities from our applications to other components, but then allow those components to call back into our application and exercise those capabilities that we've given to them. First thing we're going to take a look at is the role of pending intents. Just what is it that they serve or what purpose do they serve, and why do we use them? Then we'll look at the common usage scenarios. Pending intents have a lot of capabilities, but there's some fairly common things that we do, and there's kind of this 80 percent case of what you do most of the time we'll start out taking a look at what that is. Then we're going to take a look at pending intent sharing. As you'll see that, as you understand more about pending intents, you realize that each time you request one, you don't always get a new pending intent. Very often, you'll get a copy of one that already was created and it has some implications on how things work, so we want to make sure we understand that. And then finally, we're going to look at sending pending intents. And as application developers, most of the time, we actually create a pending intent and pass it off to some other resource. There are times though that we actually receive a pending intent and need to send that. So we're going to see exactly what those scenarios are and how we deal with those.