Sunday , November 28 2021

What is Intent in Android – Types of Intents in Android

What is Intent in Android – Types of Intents in Android – Android Intents are actually System Messages that keep the Android platform running inside the device and notify various applications running on that Android platform for different types of Events.

What is Intent in Android - Types of Intents in Android
What is Intent in Android – Types of Intents in Android

That is, the way the Operating System in our Computer System triggers different types of hardware and software events and notifies applications to complete a specific task, just like any type of hardware state change in Android Device (such as Trigger of various types of events such as inserting or removing SD cards into the device) or software state change (such as the arrival or going of new incoming data in the form of SMS or touching the menu option of the application, etc.) However, the Android system notifies the Android App to be complete of a specific task.

In other words, those which are known as Messages or Events in other Operating Systems, are called Intents under Android Platform and we can not only respond to any Intent, but also create a new Intent according to our needs. You can also launch a specific activity in response to those intents or decide when that Situation will come, when there will be a Specific Intent Trigger.

For example, if we want to Trigger an Intent when it is within the scope of 200 Meter of a Specific Location, then we need to create our own Intent to schedule such Intent.

If we try to understand in simple terms the importance of Intent as an Android Developer, then Intent allows us to move from one activity to another in response to being a Specific Hardware / Software Event Trigger.

For example, suppose that our Android App has a button on the Main Activity, which when clicked has a new Alert Box Display. In this case, Alert Box is a type of Intent that is displayed as Response when a Button is clicked.

Using Intents, we work to pass data from one activity to another activity. To fulfill any of our specific needs, we can pass the entire current activity to another activity as an object through an Intent. Not only this, we can also open a new Android application using Intents or launch / Activate a service, which invisibly fulfills any requirement of the current Android application while running in the background. is.

In simple words, Intent is the only way through which you can launch the current application or any other activity of any other Android application in response to a triggering event of the current activity of the current Android application. Whereas normally an Intent is fired within the Response of a click event triggered by a UI control located in the User Interface of the Current Activity.

The usage of intents usually fulfills the needs like sending an SMS, starting a service, launching an activity, displaying a webpage, displaying a contact list, dialing a phone number or receiving a phone call Is done to do.

Intents are not always initialized by the Android App itself, but they are also initialized by the Android Operating System so that it can give any specific notification to our Android Application.

For example, when you are using an Android App, an SMS arrives at the same time, the notification you receive of that new incoming SMS is received only through an Intent, but this Intent Initiate by Android OS, not by an application.

For example, when you tap an Exist URL in an email in your Android Device’s Mail App to see it, understanding your Intention to show the Webpage associated with that URL, the Operating System of your Android Device Web Browser itself launches the application through Intent because the Android OS knows that a URL can only be viewed by Web Browser. In this case, the Intent to be created is Automatically (Implicitly) Create by the Android System.

While clicking on a button in your Android App to launch the Web Browser Application, we have to execute our Intent by manually creating and in this Situation our Intent, Trigger to Action (Event) and its Response to Execute With the Action Handler or Event Handler being Loosely Coupled.

Activities, Views and Intents Using only these three, we can create a Completely Working Android App and there are already many Android Apps which have been developed using just these three things.

Read also – Creating New Android Studio Project using Command Line Tools

About dmtechnolab

Check Also

Simplified Coding

Android Espresso Tutorial – Testing Fragment in Isolation – Android Coding by DMTechnolab

Welcome to another tutorial in the Android test series. And this post is called Android …

Leave a Reply

Your email address will not be published. Required fields are marked *