In our real world, our actions and expressions translate our intentions. Virtual world is no different than this, android java gives us developers the power to perform actions on the android system using intentions(really??), and here’s where the android jargon of, intents, intent filters and intent resolution finds a meaning. Whenever you have an intention, you launch an intent. You wanna launch an activity from another activity, go ahead use an explicit intent, make judicious use of, setClass method and android system will do it for you. You wanna launch a service, intents at your disposal. You wanna call John doe, use an intent. Its that simple. Whenever you have an intention, you launch an intent.

Any intent is composed of 2 essential parts,

  1. Action.
  2. Data.

Hence, intent has complete information about, any action to be performed on a given piece of data.

We shall delve more deeper into this just a bit later, but for now, let’s skim the surface a bit more,

Intents come in 2 specific flavors,

  1. Explicit–>Here you explicitly specify the action you want to perform using methods like,

setComponent(ComponentName) or setClass(Context, Class).

These methods allow you to specify components(activities, services,providers,receivers) or more specifically exact classes that are to be executed via launch of the intent.

2. Implicit–>This is where the intent-filters(now what are they??), specified in your android manifest come into play and a process called as Intent Resolution takes place which goes on till the android system finds a match for your intention.

An intent filter usually exists within an activity node within your android manifest and looks something like……..

<intent-filter>

<action android:name="android.intent.action.MAIN" />
 <category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
 The above mentioned Intent filter will exist inside an activity node in the android manifest........and its intention will be to
make that activity as primary activity and entry point when the user launches your application.


Advertisements