Hire everyone in this tutorial we're going to go ahead and create another Android application.
So just click on this.
Start in your Android studio project here and then for the name of your application just type in here
app 45.
And here you can actually specify the company domain package name and product location and then click
on next here for the minimum STK choose AP is 16 Android 4.1 jelly bean.
And then click on next here.
Choose an empty activity.
OK.
So not notice that we have a blank activity and an empty activity.
Choose empty activity OK and then reconnect.
Here don't change anything.
And then we can finish.
So now as you can see our project is actually created.
So it's actually double click on these arrays.
Folder here.
And then double click on this layout folder and then double click on this activity underline main that
examen.
OK.
So here as you can see this is our Excel file.
So just click on this hell over that takes you here and then press on delete key on your keyboard.
So it's actually drag a linearly out vertical at the center of this relatively OK.
So just select this linearly as vertical here inside the layouts folder and then put it at the center
of this relatively out.
So here is our linearly out vertical.
So now let's actually direct our button into this linearly at vertical.
So just select this button here.
Inside this we just fold there and then put it at the center of this linearly L2 vertical.
OK.
And then just for the layout is assigned a value match Pallant here and double click on this button
here for the text just typing in here.
Let's open UDMA that come OK.
And for the idea to step in here of PTEN open you the me and then press on Enter key on your keyboard.
And now let's actually drag and other a button into this linearly out vertical and for the layout.
We've assigned a value match Pallant here and double click on it here for the text just typing here
let's search the google and then for the ID just typing here Pythian search Google and then press on
until key on your keyboard.
So now it's actually drag another button into this linearly as vertical.
So just put it at the center of this linearly alphabetical OK and for the layout we assign the value
match parent.
Here and Now double click on it.
So now for the text just typing here let's call someone.
And for the ID just type in here between call and then person Enter key on your keyboard.
And now let's actually drag another repotted into this linearly out vertical and put it at the center
of this linearly vertical OK.
And for the layout we assign the value match parent and double click on it.
So for the text just typing in here lets access the dial pad and for the ID just typing here between
access dial pad
OK and then a person Enter key on your keyboard.
So now let's actually select all of these buttons here.
OK.
And now let's actually find out the background attributes.
So here as you can see this is the the this is the background attribute that is related to all of these
buttons here and here I want to actually assign a color.
So here I just need to put in hash tag and put this value here at 0 0 F F F F and then press on until
key on your keyboard.
So now as you can see the color back in and color of these buttons changed.
So now let's actually select this linearly or vertical.
And here I want to actually change the background color of this linearly alphabetical.
So here again just typing here hashtag and here just type in here 45 F F D 5.
And then press on Enter key on your keyboard.
So as you can see here now I actually changed the background color of this nearly 20 code.
So now let's actually run our project and see the user interface of our application.
So here it actually changed the image emulator to Nexus 5.
OK.
So here I just need to choose this lunch emulate it and then I can select between these emulators.
So here I was Nexus 5 API 23 and then I actually checked the search box here that says Use Sainty file
save device for future launches and then press on.
OK here.
So now it's going to actually launch the emulator for me.
So now as you can see our application is running on this emulator.
And here is the design of our application.
So now let's actually go back to our main activity that java file here and here we can actually put
in our own codes here.
So first of all because we want to actually access the Internet and the Carleen feature of our device
first mini to actually open the manifest file.
And here after the application tag here we want to actually specify that we want to use some of the
features of Android and we to actually use those permissions.
So here I just need to open a tag here and here I can just type in users permission and here I want
to specify that I want to actually call someone call someone.
So here I can just type in call form.
OK and then our press Enter key on my keyboard and in here I need to actually close this task here.
So here I am actually specifying that you want to call a phone and you need to actually access that
permission.
Again I want to actually use another permission user's permission access network state.
So here is the access network state permission and then he had to select it and then person and Turkey
on my keyboard and then I need to actually close this take here.
OK.
And here again we want to actually access the Internet.
So here I just need to open attack user's permission and here I am just typing Internet and then press
enter key on my keyboard and then close the stack.
OK.
So here in our main activity that double file we need to actually again put putting some lines of code
regarding the permission to phone call.
OK.
Because we want to actually call someone in our application we need to actually put some lines of code
here in order to ask the user whether they want to actually application whether they allow the application
to call someone else or not.
OK so here I want to put those lines of code here and I'm going to paste them and then explain to you
what's going on here.
So here in our main activity class first of all we need to specify what is going to be the request code
for our permission.
OK.
So here I'm going to paste in this line of code here.
As you can see the access modifier of this of this constant is private.
This constant is actually static.
OK.
And this is actually the final constant the data type of this constant is integer and the name of this
constant is called.
OK.
And I assigned disvalue number one to this constant.
So this is going to be the request code OK for our calling permission OK because we want to call someone
we need to actually create our request code that is actually specific for that past.
OK so whenever the user clicks on this for example on this button here let's call someone.
This request code is specifically related to this.
But in our case with this feature that I want to actually call that someone OK.
So this is very important and now so because there are user interface components may want to actually
access the call and call someone of any to actually provide specific request codes for those user interface
components.
But this man this using this call request called here is going to be only for these let's call them
once someone butts in here.
OK.
So whenever the user touches this button here it is going to call someone OK it is going to access the
card feature of the device and can someone and that's request code and that request could hear inside
our main activity here is going to be only specific to that button.
OK.
So now I have a request code and the name of the request code is call and I assigned this value number
one to this because it's called here to this constant.
So here I'm going to paste in some lines of code here.
So as you can see here I actually pasted these lines of code here.
OK.
And now I'm going to explain to you what's going on here.
So here I actually created an array.
OK.
And array of type string and the name of my address is permissions.
So as you can see here the access modifier of my address is private.
My address is static.
OK.
And here inside inside my array I have only one value.
OK manifest that permission that calls someone.
OK so let me actually did that come here.
So I have only one value one permission manifest that permission.
That code.
So I want to actually access the call feature of my device.
OK.
So here I need to ask the user whether they want to allow my application to access the call feature
of the device or not.
If they allow me.
OK.
If they allow me I can call someone if they don't allow me.
I would not be able to call someone.
OK.
So here I have this method in order to ask the user whether they allow me to call someone or not.