Hire everyone in this theater you are going to go ahead and create our 14th Android application.
So just click on this.
Start in your Android studio project.
And here we need to actually specify our name for our application app 14 and you can actually specify
the company domain package name and project location.
Click next and here choose API 16 Android 4.1 jellybean.
OK click clicking next blank activity.
Next And here don't change anything.
And then we can finish here.
Delete this hello or text view.
And then double click on the rest folder and lay out and then double click on the activity on the line
main and then select this fluting action button and then press delete key on your keyboard.
OK.
So let's go back inside this content on the line of the example.
And here we can actually design our user interface.
Ok.
Ok everyone.
Now let's actually track our linear layout vertical into this relatively alloca.
So let's just drag it at the center of the are relatively OK.
At the center of the screen and as you can see here these are linearly at vertical.
So now it's actually dreich are linearly out horizontal into this linear layout vertical OK.
So these are linearly out horizontal.
And now let's actually track two large takes views into this linearly or horizontal that is inside of
this linear left vertical.
OK.
So double click and these are large text view.
And for the text just type in here.
Total value of the array.
OK.
And as you can see here this is our value here.
And now let's actually track and others takes you into this linear layout horizontal select this large
text and then I put it inside these linearly and horizontal and double click on it and delete the text
of this text view.
And for the idea Id just type in here takes the total.
OK.
And as you can see here these are our two text views that are actually inside of these linearly and
horizontal.
OK so now let's assume that the weight of this linearly and horizontal is 100.
OK so now I want to actually allocate 80 percent of the width of these linearly at horizontal to this
it takes you here OK total by the total value of the array.
So here for the width of this takes you just assign the value 0 and for the weight of this text view
for the length of 8 assigned the value 80.
So let me explain again.
I assumed that the weight of these are linearly held horizontally is 100.
OK.
And I want to actually allocate 80 percent of the weight of this linearly or horizontal to the weight
of this a total value of the Great Lakes view OK.
So I actually assigned the value 0 to the of which of these takes you.
And then I assign the value 80 to the left rate of the sticks.
OK.
So here now we have 20 percent left.
OK.
20 percent of the lay out of the way of these are linearly or isn't what is left.
OK so now let's actually get the value 0 to the lay out which of these takes the total takes view.
OK.
And assign the value 20 to deliberate rate of this takes you.
So as you can see here now this takes you is actually taking 20 percent of the vote of this linearly
and horizontal Okay.
So this is our linearly or horizontal and we assumed that the weight of these artists is 100.
OK.
One hundred percent.
And we gave 80 percent of the base of this linearly or horizontal to this text view here total value
of the array and I assign the value 0 to the level to which of the state's view.
And then I assign the value 80 to the weight of the sticks.
And here I actually assigned the value 0 to the left.
Which of these takes you and I assign the value 20 to the left rate of this takes you OK.
So hopefully that makes sense.
And let's actually track another linearly or horizontal into this linearly alphabetical.
Okay.
So let's actually select this linearly and horizontal and then put it inside this linearly and vertical
OK.
And let's actually do a large text view into this linearly and horizontal OK.
You can either put it here or get inside this layout or you can actually inside this component restriction.
Again just put it here inside this linearly out horizontal OK.
And now that's actually double click.
And these are text view for the text.
Just delete the text of this text view.
And for the ID just type in here DXi triangulations.
OK I want are these tactics the calculation takes you to be at the center of this linearly or horizontal.
So I just need to clear this linearly at horizontal and then I can just find the gravity attribute here.
As you can see.
So I just need to check this check box here that says Center underline horizontal OK.
So if I select this takes you now as you can see this text view is at the center of this linearly out
horizontal OK.
It is actually positioned at the center of this linearly and horizontal.
So now let's actually go back and say this main activity that I will find here again delete these lines
of code that are actually related to the options menu here.
This block of code that is actually related to the to the floating action button.
And now we can actually put our own code here.
OK.
Now inside these are uncreate Smurfette.
Actually create two text view objects.
So I just need to refer to the name of the text your class DX the total
OK assignment operator and then I need to actually cast this object to take textbook object find view
by id artist or E.T. that takes the total OK and this actually create another text object to the calculations
OK.
Assignment operator.
And then here I need to cast this object to test your object find view by ID or thought Id dot the calculation.
Okay.
And here let's actually create a string object all text and I don't want to actually insensate this
object here.
So now this actually creates an array of integer numbers.
So I just need to refer to the name of the integer primitive data type.
OK.
And then I want to actually specify that I am going to actually and then I need to actually specify
that I am going to actually create an integer Ali by putting a pair of brackets after my type and then
I need to actually give a name to this array.
So I just need to type in here integer array and then I put an assignment operator here and now I want
to actually instantiate this array.
So I just put in a pair of curly braces here and then I will actually specify my values that I want
to actually assign to this address.
OK.
So here for example Number 2 54 54 76 23 and 4 7 8 6 4 and 65.
OK.
And now I can actually put a semicolon at the end of my statement here.
And let's actually create an integer variable in total value assigning number 0 to this variable and
essentially create a for loop here.
OK for each index.
OK.
And then I assign number 0 to this variable.
And then here I need to actually specify a condition in which this loop is going to be executed until
index is less than integer array.
OK that length.
And now I need to actually specify that.
And here I need to actually specify that after each execution of this for a loop the value of this index
variable is going to be incremented by 1 index plus plus.
And then I need to actually open and closed this for loop by using these curly braces.
And here I want to actually add the values of the integer array together and then I want to assign that
value to the total value.