Hire everyone in this theater you are really going to go ahead and create this application.
So as you can see here we have our tip calculator here and we have also these calculators savings calculator.
So for example I actually assign a number here.
So it's this value here and now for example I assigned the value of five hundred.
And here as you can see here I can actually specify the percent.
So for example 30 percent of this value 500 and the tip is one hundred and fifty fifty dollars.
As you can see here and the total value is $650.
Right.
So this is tip calculator.
And we have also this calculator savings calculator.
So for example I can assign a salary here.
For example I earn $10000 a month.
And then as you can see if we actually disappear this keyboard here the spiritual keyboard now I can
specify how I should keep up the percent that I want to save.
So for example if I want to save 50 percent of my I should be a salary.
So here I can specify that value 50 percent and now here it says saved money is $5000.
OK.
So this is actually a savings calculator.
So in this tutorial we're going to go ahead and create this application and here as you can see we have
some material design work here and here it is our app iPod.
And here it is the status bar here you can see that they actually changed the field of DS actually of
these components inside my screen.
So now let's actually create this application.
First of all of you need to open the Android studio.
So now let's create an android studio project.
So just click on this start in your Android studio project and then for the name of your application
to step in your app 60 and then you can specify the company domain package name and product location
and then click next and here for the minimum STK choose AP I-24 and rate 7.
No get.
Okay.
And then click on next.
And here you need to choose the empty activity next.
And here you can specify a name for the activity and you can actually specify a name for your layout.
And here you can actually legally can't finish.
So before I actually click on these finished make show to actually that these two checkboxes are actually
checked on generate layout file and backwards compatibility Abercorn Pat and click on finish.
So now it's going to actually create odd Android studio project.
So we need to wait a little bit here.
So as you can see here our project is actually created.
So now let's design the user interface of our application.
So just click double click on this this folder here.
And then double click on this layout folder.
And here.
Double click on this activity underlayment at examen and here as you can see this is the design of our
user interface.
First let's actually delete this hellova word text view here and now let's actually click on this text
tab here at the bottom.
So here here are the actually XML codes.
So now we can actually put the example code here and then we can actually preview to use an interface
here by clicking on this preview here at the right hand side.
So as you can see here we have our relatively out here right.
So now let's actually change this relatively out to linearly out just select is relatively out here
and just type in linear layout and here as you can see we have a linear layout and here as you can see
we have an error and it says no orientation is specified and the default is horizontal.
This is a common source of bugs when children are added dynamically.
So now let's actually add an orientation attribute to this linear layout.
So before the ending tag of this linearly out here I just need to press an energy on my keyboard in
order to create a new line.
And here I just type in orientation vertical.
So here as you can see we can actually choose these options.
But here I want to choose this vertical orientation.
Soon as you can see we have our linearly out vertical here right.
So now let's go inside linearly and here and now I'm going to PCMs some lines of code here and then
I'm going to explain to you what's going on here.
So as you can see here these are the lines of code that are actually pasted here.
So first of all they actually opened a tag and I want to actually create a text view as you can see
here.
So I actually typed in takes view and as you can see here these are the attributes of my text view.
So first of all I need to specify the text of my text view.
So this is teep calculator.
This is the text of my tastes view and the layout of it is match parent as you can see here the layout
height is wrapped content.
The layout gravity is centered horizontal.
The Lay of gravity is is going to actually determine the position of this text view according to its
parent.
So its planet is linearly up right.
So it's going to actually center.
This takes you inside this linearly out as you can see here its gravity center horizontal and padding
for all borders for all directions is 15 deep as you can see here.
We have a padding for the state's view as you can see here and the background is this color Android
at sign and recall in color home or orange color.
You can actually specify other colors so if they ask you to change this all hollow underline orange
color for example and here you know in order to actually see the options I just need to hold the control
here and then click on and then press on the space key on my keyboard.
And here as you can see these are the colors that I actually can choose for my taste view as you can
see here.
So now I'm going to actually hold the common key or the control key and then click on it and the person
then little Zichy on my keyboard.
So I actually chose this holo color for my taste for the Baggott and of my takes view and the text size
is 20 s.p.
So remember if you want to specify the text size of your user interface components make sure to use
s.p.
This is it.
This is very important.
And here we have a new attribute that you haven't seen so far elevation.
So let's look at our application here.
Inside this emulator.
So as you can see here we have some shadows here for the for this takes real teeth.
This is the calculator.
Here we have some shadow.
And this is because of this attribute elevation.
So now I actually want to create this elevation here at this elevation attribute so we need to actually
assign our an integer value.
But I didn't want to actually hard code this elevation.
So let's actually open our project structure.
So here I just need to click on this view tool windows and then click on project and then here inside
this app folder.
Inside is less folder as you can see we have these values for the right.
So let's go inside these values folder and here as you can see we have some xml files colors that are
similar dimensions that simple strings that examen and these tiles that exhibit.
So here as you can see I actually referred to as sign D-men.
So I actually want to refer to this XML file so if I actually open this folder as I can see we have
some xml files here.
So if you want to choose this one demands that example.
OK.
So DoubleClick and these demons are examined here and here is arguments are exemplified.
And now I can actually for example add some other values here.
OK.
So for example I want to actually assign the value 16 DP issue.
I should not actually hard code that value.
I could create a resource here and then the first with the name of this resource here in order to actually
use this value.
So for example if we actually want to use this elevation here I just need to hold the option key on
my keyboard.
If you are using any of those machine you need to hold the old key on your keyboard and then click on
the person until 3 on my keyboard here.
As you can see and here it says create D-men value resource elevation.
And here I can specify the resource value.
So the resource value is going to be an elevation and the source said it's going to be made and the
file name is actually the demons that exist right.
So here I just need to present or take.
OK and the Stalock as you can see here.
And now let's go inside the statements that they submit here as you can see we have this elevation here
right.
It actually put this elevation attribute here.
So domain name and the name is the name is elevation.
And here is the value.
I don't want this value I want an integer value because I want to specify a shadow for this takes you
right for this takes.
This is the calculator so I need an integer value in order to actually specify a shadow for the states.
So let's go inside these statements that example just delete this elevation here and then assign the
value.
For example 15.
And now let's go inside this activity underlayment and examine and here as you can see it says dimension.
We have our rendering problem here.
As you can see it says dimension 15 in attribute elevation is missing unit.
OK.
So let's go back to immensities and here here.
I need to specify the unit.
The unit is going to be D P.
Ok density pixels.
And if I go back to what activity or delaminate example.
And as you can see here the error is gone and we have a shadow here but we cannot see that here.
And this is a bug in Android studio.
So we need to actually run our project in order to actually see the shadow here.
The shadows actually around these takes you so elevation 15.
And let's actually run our project.
But before that let me talk about this lay out multi-button.
So you actually assigned this margin bottom for this takes you lay out margin but one DP.
This is very important that you need to specify there actually a DPD unit for your values.
So let's run our project now and see what happens.
So make sure to choose next to six or up devise an emulator that actually runs AP I-24 and wait seven.
And then we can.
OK.
Here.