



for send email action, you need to provide email address parameter) When creating a new Intent you need to tell it what you want to do and give it necessary parameters for such operation (e.g. In this case, you use Intent to execute some action. Intent as an intent – a will to do something.By sending Intents between different components, we can coordinate complex actions such as launching email app to send a message, using Location for obtaining user’s coordinates or navigating between application’s screens.įor me, we can think of Intents and their usage from two perspectives: In general, you can think of an Intent literally – it’s the intent (or a will) to do something. Application Blocks use Intents to asynchronously communicate with each other. Different Blocks don’t know much about each other (even if defined within the same application). It means that each app has access only to Blocks which it requires to work. Moreover, there is a principle of least privilege introduced in system’s architecture. What is an Intent ?Īndroid system is designed to be loosely-coupled. Then, as soon as any other app uses Intent to make a phone call (which we’ll see in this post), Application Chooser appears and your app will be one of the possible ones to use for making this phone call. The same can be done with your own app – if you’re developing a dialer app, you can register it to be callable for ACTION_DIALActivity Action. when you wanted to open downloaded movie and the system asked you which video player you want to use.

We’ll see more details in a while, but generally your app block is “callable” when it can be used by the other apps – probably you’ve already seen Application Chooser screen on your Android phone, e.g. Especially, in this XML file (or by using various attributes on Activity class) it’s possible to register our Application Block to be “callable” by the others. Passing additional content using Intent as a messageĪndroid apps are composed of Application Blocks, which are special kind of Android classes consisting several elements bundled together, including:Įverything that comes in such package is coordinated by AndroidManifest.XML file.
