Hi everyone in this tutorial we're going to go ahead and create another Android application.
So just click on this.
Start any Android studio project and for the application name just type in here app 24 and then click
on next here choose AP I-69 Android 4.1 Jelly Bean for the minimum STK.
Next here choose plant activity next and here click on finish.
OK.
Now select this hello world takes view here and then pressed on delete key on your keyboard and then
double click on the folder layout activity line that example and in and adhere selectees fluting action
button here and then press on delete key on your keyboard.
OK so now let's actually go back inside.
Is our content underline that example and then double click on this tab so that this area is now wider.
OK and now let's actually design the user interface of our application.
So first of all when it actually linearly linearly out vertical here select is linearly alphabetical
here and put it at the center of this relatively here.
OK.
Now let's actually select these are large takes we are here and then put it inside these are linearly
L2 article here.
OK.
And double click on this text view.
And for the text just typing here the original values of the array are colon.
OK.
And then press and enter key on your keyboard.
So now it's actually the right scroll view horizontal OK a horizontal scroll view into this linear length
vertical here.
So select this horizontal scroll view here and put it inside these linearly as vertical and put it at
the center.
OK.
And here as you can see this is our horizontal scroll view.
So as you can see here this is the layout.
And this is the height of this horizontal scroll.
OK.
So select this lay out width of this horizontal scroll view here and then select the wrap content here.
OK.
And then for the length height again select as you can see wrap content.
OK.
And now let's actually write a text view into this horizontal scroll view here.
OK.
So just select this large text view here as you can see and put it inside this horizontal scroll you
here.
OK.
And now let's actually select the text here.
Double click on it and delete the text of this text view.
And for the OED just typing here takes the arrow values.
OK.
And then present enter the key on your keyboard.
OK so now let's actually select another large text view here as you can see and put it inside this linearly
alphabetical.
Here here.
Just put it at the center of this linearly of 20 collocate as you can see.
I made a mistake and put it at the right of this linearly Ellsworthy code.
So I just need to select it and put it at the center of this linearly alphabetical and double click
on it.
OK.
And for the text just typing here the average value is colon.
OK.
And then precedented here on your keyboard.
So now let's actually select another large X view and put it at the center of this linearly or two vertical
here.
OK.
As you can see this is this is the center and double click on it deletes the text of this text view.
And for the OED to say it in here takes the average value OK and then press on the Enter key on your
keyboard.
OK so now let's actually go back inside this main activity of it here and select these are lines of
code that are actually related to the Options menu.
And then here select this block of code that is actually related to the floating action button and then
present the key on your keyboard.
OK so now we can actually put our own codes here.
So here I just play it in some pasting some lines of code and then I'll explain to you what's going
on here.
OK.
So here as you can see first of all I actually created an object from this text last year x the Arab
values.
And here you refer to the name of this ID or KTXA takes the three values.
And here I actually created.
I declared actually the string valuable here and I didn't instantiate this variable yet.
And the name of this string variable is all takes the array values.
OK.
And here I created another object from this takes view class and the name of this object is the X the
average value OK.
And here I just referred to the name of these ID or that ID that the average Raddy OK.
So now this actually creates an array of integer numbers.
OK.
As you can see this is our array of integer numbers.
This is actually a one dimensional array.
OK.
And the name of this area is inked array.
And here I specified these values.
OK.
And then I assign these values to this a.
Ok so now let's actually create a for loop here.
So as you can see here this is my for loop and inside Apprentice's of this for loop.
First of all I created a variable of type integer and then I assigned the value 0 to this variable.
And here I specified that until the value of this index variable is less than the value of the length
of this in a.
Then this loop is going to be executed.
And here I actually incremented this value by one OK after each execution of these for a loop the value
of this index variable is going to be incremented.
OK well you've won and now it's going to be incremented by 1.
OK.
And here inside of the for loop as you can see we have actually instantiated this value.
OK.
All takes the added values.
Here we created this.
Actually we declared this string value in line 19.
And here in line 24 25 inside of this for loop we actually decided to instantiate this variable.
So all the added values assignment operator takes the array values that get text that string.
Here I am actually getting the text of this the x values.
And here I am actually converting this value to a string value.
And here I am actually assigning.
That's why I do this all the x the Arab values here.
OK.
And here I just referred to the name of the 63 values here.
That said text all the Arab values plus ain't ready as you can see in a is actually this Adye that we
actually created in 9:22 and inside brackets of this area I just referred to the name of this index
here.
So it's RASM index.
So for example for the first time that this group is going to be executed the value of this index value
but is zero.
So it's going to actually go inside the index 0 of this area and then it's going to actually give me
this value.
OK.
And here I just created a concatenated value of it is a string value.
Actually I put in a space here and now let's actually run our project and see what happens.
So as you can see here now our application is actually running on this emulator.
And here we can see the original values of the array and these values are actually inside these horizontal
scroll view.
And I can actually scroll to the left in order to see the other values.
OK.
So let's actually go back and say this content underline minute example and here I need to click on
this Kilcash here and now I can't just select this horizontal scroll view and for the layout height
again just assigned a value number 50.
OK I can just select this and assign the value in over 50.
And let's actually run our project again and see what happens.
As you can see here now our application is running on the simulator.
And here if I scroll to the left we can see these values here.
OK.
So hopefully that makes sense.
And now let's actually go back inside this main activity the job of right here and here let's actually
add some lines of code here OK.
First of all it's actually create on my foot here.
So here I just pasting this method and then I'll explain to you what's going on here.
OK.
So as you can see here this is on my foot and the Axis modifier of the Smurfette is public.
The return type of this method is in integer and the name of this method is get the average value.
OK.
And here we have a special type of argument.
OK this is actually an array of integer numbers.
And we could actually add unlimited numbers as an argument to this effect.
OK.
As an argument and let's see how we can use that.
OK.
First of all instead of this Smurfette as you can see I actually created a variable of type integer
and the name of the sum of it the name of this value is actually total value.
And then I assign the value 0 to this variable OK.
And then here I created an enhanced for loop.
So for an inside the practices of this for loop I specified first of all I actually created a variable
of type integer value colon numbers.
So this value here is actually going to iterate over the values that are inside of these numbers arey.
OK so this is very important.
Int dot dot space numbers.
OK.
This is the type of our Aure Okay.
And here when we actually we are actually going to use this method.
Alex you how we can use these Smif at the Cape.