Hey guys, welcome to protocol as point
Okay so in this part of tutorial we are going to learn 4 things that is how to make a phone
call, open a URL, send a SMS and the email that too by making use of one library that
is URL sponsor. So let's begin with the tutorial. Okay so now we are in our android studio
So first of all let's add a dependency, just open for specification.yaml file and under
dependency section over here let's add a URL launcher. Okay so after adding that let's hit this object button
Okay so our dependency got added in our project. So now let's go to main.dash file
Over here let's input a URL launcher.dash file. Okay so now you can use this property of this site id
Okay so let's create some buttons. So now here in the preferred widget I have a simple container
So I will just remove it and under that I will just make use of column widget and column
widget will have more than 4 buttons, 4 button something. Okay so let's add some buttons over here
Elevation button, context, let's give a text to this button. Okay so like this let's create 3 more buttons
Okay, make a column, send a SMS, send a email
Okay so now 4 buttons are ready. So I will just run the project
Okay so as you can see 4 buttons got created. So let's bring it to center, main access alignment, main access alignment center and the whole
column widget will bring to center. Refresh. Okay so now there is no functionality we will add it to this button
So let's add it now. So let's make a call. So to make a call we will just make use of launcher, launcher and then to make a call
there is a command that is tell and here you need to pass a number to which you want to
make a call. Okay so just add a number over here. So now I will just restart our app, let's check the functionality
Okay so I think app got restarted when I press on this call button
So you can see our phone app got opened with our as defined number over here
Okay so now let's check for how to send a SMS. So to send a SMS let's copy this, I will just copy it and inside here instead of this
tell you must make use of command that is SMS and you need to pass the number over here
Okay and after that you just give a question mark and a body tag is equal to, here you
need to pass a message. Okay so I will just repress the app, it got reload
Okay so now when I press on this send SMS, you can see our SMS app got opened with a
message that you have defined over here. So you can just send the message like this
Okay so now let's check how to send a email. So for that, same let's copy this, I will just remove and for mail you need to make
use of command that is email2 and over here you need to specify the email address
The email.com, just give a question mark and email address has three properties that is
subject and the body of the email. So subject is equal to, I can give subject as, this is subject body, subject title I
can give, okay and just add and separate this and body is equal to, this is body of email
like this. So let's check if it is working, I have just reloaded
So when I press on this button, you can see the email app gets opened with our text that
we have defined. This is subject, this is body of the email and 2, 2 address
So this is the 2 address. Okay so now let's check how to make a copy, sorry how to open a URL
I will just copy this, okay so to open a URL, here you need to just pass the URL that you
want to open. So I will just pass the URL, I will just reload
Okay so now let's check, sorry one second, okay I will just repress
So when I press on this open a URL, you can see a browser gets opened with the defined URL
Okay so that's all for this video tutorial. Hope you got the concept of how to make use of this URL launcher to add this functionality
to your Twitter application. Okay thanks for watching. Please do subscribe to AutoCode as well. Thanks