From the course: Android Development: Understanding Intents

What are intents? - Android Tutorial

From the course: Android Development: Understanding Intents

Start my 1-month free trial

What are intents?

- [Narrator] Okay, let's start off by understanding a little bit about what intents are and how they are used. Intents, in Android, are messaging objects and they are used to pass data to other components of your app or other Android apps. And typically, they are used to start activities in your own app or pass information to other apps that performs specific functions. So let's examine a few scenarios for how intents are used in Android. If you look at how most modern Android apps are built, they are constructed out of a set of individual components, and these components can include activities, which represent individual screens in your app, or other components like services. Using intents, your application can start other activities in your own app or you can ask other applications or even the Android OS itself, to perform an action on your app's behalf. So, for example, your app can indicate that it would like to display a location on a map and ask a specific application, like Google Maps, to perform that action. Your app could also create an intent and then ask the system to figure out which apps should handle it. Intents can also be used to retrieve information from other components. So, for example, you can use an intent to ask the system to start the camera to take a photo for you, and then have the photo information returned back to your app via an intent return. You could also give an intent to the system or another application that would be invoked at a future time, for example, you can tell the system which activity to start in your app when the user taps on a notification. These are called pending intents and we'll learn more about them later in the course. During the course of your app development you will create intents that are intended to be used only within your app, but the Android system also provides a pretty comprehensive set of predefined intents that your application can leverage to perform a variety of common functions. As we go through the course, we will learn about many of these intents and see how to make use of them.

Contents