Hello everyone welcome to KnowledgeSuttra. In our previous blog Layout and views, we saw the types of layouts and views, and we saw functionality of them. Our today’s topic is Intent; intent is most important part in Android application development. Intent is use for services; to use or access any kind of services we need Intent. If our android application contains more than one activity that time we use Intent to move or jump from one activity to another activity. Today we will see the types of Intent. Need of Intent and functionality of them.
Intent gives a facility to performing late run-time binding between the codes in various applications. Its most huge utilize is in the starting of Activities, where it can be thought of as the paste between exercises. It is essentially a passive information structure holding a unique depiction of an activity to be performed.
Types of intent
In the books of Android development they say that there are two types of Intent.
- Explicit Intent
- Implicit Intent
But there are one more Intent which in not consider is called Pending Intent.
Explicit Intent is the simplest type of intent it doesn’t interact with other services. It work between Activity’s it provides connectivity to jump from one activity to another activity. It is a way for an application to launch various internal activities it has as the user interacts with the application.
Implicit Intent is type of intent which works with the services internal and external both. Internal services means services which is available in the phone for example camera, music player, gallery, etc. External services means which are not available in phone for example sms, mail or Internet, etc. It is use for Activity, broadcastReciver, services.
This is handled by the process of Intent resolution, which maps Intent to an Activity, broadcastReciver, services that handle it. The intent resolution mechanism basically revolves around matching Intent against all of the <intent-filter> descriptions in the installed application packages.
Pending intent is not considered as intent resolution. This type of intent use for notifications, as we saw in our phone the notification shows the short message we can read by clicking on it or ignore by swapping it. This all can do with the help of pending intent.
Primary attributes which include with Intent
- action:- the general action, like ACTION_MAIN, ACTION_VIEW, ACTION_EDIT, etc
- data :- the data which we use or operate, like contacts
Other than this primary attributes we have some secondary attributes