1
00:00:00,710 --> 00:00:06,360
Hi everyone in this tutorial we're going to go ahead and create another Android application.

2
00:00:06,580 --> 00:00:07,650
So just click on this.

3
00:00:07,660 --> 00:00:16,120
Start any Android studio project and for the application name just type in here app 24 and then click

4
00:00:16,120 --> 00:00:22,980
on next here choose AP I-69 Android 4.1 Jelly Bean for the minimum STK.

5
00:00:23,080 --> 00:00:29,200
Next here choose plant activity next and here click on finish.

6
00:00:29,490 --> 00:00:30,090
OK.

7
00:00:30,250 --> 00:00:37,000
Now select this hello world takes view here and then pressed on delete key on your keyboard and then

8
00:00:37,000 --> 00:00:44,140
double click on the folder layout activity line that example and in and adhere selectees fluting action

9
00:00:44,140 --> 00:00:47,670
button here and then press on delete key on your keyboard.

10
00:00:47,680 --> 00:00:50,170
OK so now let's actually go back inside.

11
00:00:50,210 --> 00:00:57,050
Is our content underline that example and then double click on this tab so that this area is now wider.

12
00:00:57,070 --> 00:01:02,080
OK and now let's actually design the user interface of our application.

13
00:01:02,290 --> 00:01:09,070
So first of all when it actually linearly linearly out vertical here select is linearly alphabetical

14
00:01:09,070 --> 00:01:13,620
here and put it at the center of this relatively here.

15
00:01:13,630 --> 00:01:14,090
OK.

16
00:01:14,140 --> 00:01:21,580
Now let's actually select these are large takes we are here and then put it inside these are linearly

17
00:01:21,590 --> 00:01:22,550
L2 article here.

18
00:01:22,600 --> 00:01:23,210
OK.

19
00:01:23,650 --> 00:01:25,300
And double click on this text view.

20
00:01:25,480 --> 00:01:31,190
And for the text just typing here the original values of the array are colon.

21
00:01:31,210 --> 00:01:31,930
OK.

22
00:01:32,260 --> 00:01:34,970
And then press and enter key on your keyboard.

23
00:01:34,990 --> 00:01:41,710
So now it's actually the right scroll view horizontal OK a horizontal scroll view into this linear length

24
00:01:41,710 --> 00:01:42,670
vertical here.

25
00:01:42,820 --> 00:01:49,480
So select this horizontal scroll view here and put it inside these linearly as vertical and put it at

26
00:01:49,480 --> 00:01:50,020
the center.

27
00:01:50,020 --> 00:01:50,750
OK.

28
00:01:51,190 --> 00:01:54,230
And here as you can see this is our horizontal scroll view.

29
00:01:54,400 --> 00:01:57,720
So as you can see here this is the layout.

30
00:01:58,030 --> 00:02:01,520
And this is the height of this horizontal scroll.

31
00:02:01,520 --> 00:02:01,910
OK.

32
00:02:02,080 --> 00:02:10,580
So select this lay out width of this horizontal scroll view here and then select the wrap content here.

33
00:02:10,660 --> 00:02:11,420
OK.

34
00:02:11,770 --> 00:02:17,580
And then for the length height again select as you can see wrap content.

35
00:02:17,680 --> 00:02:18,690
OK.

36
00:02:19,290 --> 00:02:25,050
And now let's actually write a text view into this horizontal scroll view here.

37
00:02:25,090 --> 00:02:25,860
OK.

38
00:02:25,960 --> 00:02:32,650
So just select this large text view here as you can see and put it inside this horizontal scroll you

39
00:02:32,650 --> 00:02:33,200
here.

40
00:02:33,370 --> 00:02:33,800
OK.

41
00:02:33,820 --> 00:02:37,800
And now let's actually select the text here.

42
00:02:37,810 --> 00:02:41,690
Double click on it and delete the text of this text view.

43
00:02:41,830 --> 00:02:45,240
And for the OED just typing here takes the arrow values.

44
00:02:45,250 --> 00:02:45,830
OK.

45
00:02:46,150 --> 00:02:48,720
And then present enter the key on your keyboard.

46
00:02:48,730 --> 00:02:58,030
OK so now let's actually select another large text view here as you can see and put it inside this linearly

47
00:02:58,030 --> 00:02:58,630
alphabetical.

48
00:02:58,630 --> 00:02:59,230
Here here.

49
00:02:59,260 --> 00:03:04,170
Just put it at the center of this linearly of 20 collocate as you can see.

50
00:03:04,210 --> 00:03:08,200
I made a mistake and put it at the right of this linearly Ellsworthy code.

51
00:03:08,230 --> 00:03:14,790
So I just need to select it and put it at the center of this linearly alphabetical and double click

52
00:03:14,790 --> 00:03:15,340
on it.

53
00:03:15,430 --> 00:03:16,130
OK.

54
00:03:16,480 --> 00:03:22,870
And for the text just typing here the average value is colon.

55
00:03:23,020 --> 00:03:23,640
OK.

56
00:03:23,860 --> 00:03:26,170
And then precedented here on your keyboard.

57
00:03:26,470 --> 00:03:32,140
So now let's actually select another large X view and put it at the center of this linearly or two vertical

58
00:03:32,140 --> 00:03:32,590
here.

59
00:03:32,620 --> 00:03:33,130
OK.

60
00:03:33,130 --> 00:03:39,300
As you can see this is this is the center and double click on it deletes the text of this text view.

61
00:03:39,430 --> 00:03:49,360
And for the OED to say it in here takes the average value OK and then press on the Enter key on your

62
00:03:49,360 --> 00:03:49,730
keyboard.

63
00:03:49,750 --> 00:03:57,550
OK so now let's actually go back inside this main activity of it here and select these are lines of

64
00:03:57,550 --> 00:04:00,150
code that are actually related to the Options menu.

65
00:04:00,640 --> 00:04:06,400
And then here select this block of code that is actually related to the floating action button and then

66
00:04:06,400 --> 00:04:08,600
present the key on your keyboard.

67
00:04:08,660 --> 00:04:11,680
OK so now we can actually put our own codes here.

68
00:04:11,680 --> 00:04:16,870
So here I just play it in some pasting some lines of code and then I'll explain to you what's going

69
00:04:16,870 --> 00:04:17,200
on here.

70
00:04:17,200 --> 00:04:17,780
OK.

71
00:04:18,040 --> 00:04:25,380
So here as you can see first of all I actually created an object from this text last year x the Arab

72
00:04:25,390 --> 00:04:26,070
values.

73
00:04:26,320 --> 00:04:31,470
And here you refer to the name of this ID or KTXA takes the three values.

74
00:04:31,690 --> 00:04:33,410
And here I actually created.

75
00:04:33,710 --> 00:04:41,260
I declared actually the string valuable here and I didn't instantiate this variable yet.

76
00:04:41,410 --> 00:04:45,300
And the name of this string variable is all takes the array values.

77
00:04:45,370 --> 00:04:46,030
OK.

78
00:04:46,480 --> 00:04:53,800
And here I created another object from this takes view class and the name of this object is the X the

79
00:04:54,310 --> 00:04:55,620
average value OK.

80
00:04:55,810 --> 00:05:01,810
And here I just referred to the name of these ID or that ID that the average Raddy OK.

81
00:05:02,420 --> 00:05:06,180
So now this actually creates an array of integer numbers.

82
00:05:06,260 --> 00:05:06,740
OK.

83
00:05:06,800 --> 00:05:10,060
As you can see this is our array of integer numbers.

84
00:05:10,100 --> 00:05:12,340
This is actually a one dimensional array.

85
00:05:12,380 --> 00:05:13,010
OK.

86
00:05:13,280 --> 00:05:16,110
And the name of this area is inked array.

87
00:05:16,280 --> 00:05:19,010
And here I specified these values.

88
00:05:19,010 --> 00:05:19,270
OK.

89
00:05:19,280 --> 00:05:21,670
And then I assign these values to this a.

90
00:05:21,700 --> 00:05:25,690
Ok so now let's actually create a for loop here.

91
00:05:25,820 --> 00:05:31,080
So as you can see here this is my for loop and inside Apprentice's of this for loop.

92
00:05:31,190 --> 00:05:37,360
First of all I created a variable of type integer and then I assigned the value 0 to this variable.

93
00:05:37,520 --> 00:05:43,770
And here I specified that until the value of this index variable is less than the value of the length

94
00:05:43,800 --> 00:05:45,300
of this in a.

95
00:05:45,470 --> 00:05:47,490
Then this loop is going to be executed.

96
00:05:47,570 --> 00:05:54,920
And here I actually incremented this value by one OK after each execution of these for a loop the value

97
00:05:54,920 --> 00:05:57,310
of this index variable is going to be incremented.

98
00:05:57,340 --> 00:06:02,690
OK well you've won and now it's going to be incremented by 1.

99
00:06:02,690 --> 00:06:03,190
OK.

100
00:06:03,320 --> 00:06:11,820
And here inside of the for loop as you can see we have actually instantiated this value.

101
00:06:11,860 --> 00:06:12,370
OK.

102
00:06:12,480 --> 00:06:14,570
All takes the added values.

103
00:06:14,660 --> 00:06:16,220
Here we created this.

104
00:06:16,460 --> 00:06:19,880
Actually we declared this string value in line 19.

105
00:06:20,090 --> 00:06:29,080
And here in line 24 25 inside of this for loop we actually decided to instantiate this variable.

106
00:06:29,240 --> 00:06:36,440
So all the added values assignment operator takes the array values that get text that string.

107
00:06:36,590 --> 00:06:39,830
Here I am actually getting the text of this the x values.

108
00:06:40,010 --> 00:06:44,240
And here I am actually converting this value to a string value.

109
00:06:44,250 --> 00:06:45,700
And here I am actually assigning.

110
00:06:45,700 --> 00:06:48,800
That's why I do this all the x the Arab values here.

111
00:06:48,800 --> 00:06:49,530
OK.

112
00:06:50,000 --> 00:06:54,340
And here I just referred to the name of the 63 values here.

113
00:06:54,410 --> 00:07:03,530
That said text all the Arab values plus ain't ready as you can see in a is actually this Adye that we

114
00:07:03,530 --> 00:07:10,670
actually created in 9:22 and inside brackets of this area I just referred to the name of this index

115
00:07:10,670 --> 00:07:11,250
here.

116
00:07:11,270 --> 00:07:13,040
So it's RASM index.

117
00:07:13,040 --> 00:07:17,760
So for example for the first time that this group is going to be executed the value of this index value

118
00:07:17,760 --> 00:07:18,840
but is zero.

119
00:07:18,860 --> 00:07:23,420
So it's going to actually go inside the index 0 of this area and then it's going to actually give me

120
00:07:23,540 --> 00:07:24,100
this value.

121
00:07:24,110 --> 00:07:24,850
OK.

122
00:07:25,250 --> 00:07:31,610
And here I just created a concatenated value of it is a string value.

123
00:07:31,610 --> 00:07:38,540
Actually I put in a space here and now let's actually run our project and see what happens.

124
00:07:38,540 --> 00:07:43,370
So as you can see here now our application is actually running on this emulator.

125
00:07:43,610 --> 00:07:49,820
And here we can see the original values of the array and these values are actually inside these horizontal

126
00:07:49,820 --> 00:07:50,600
scroll view.

127
00:07:50,840 --> 00:07:54,560
And I can actually scroll to the left in order to see the other values.

128
00:07:54,560 --> 00:07:55,240
OK.

129
00:07:55,310 --> 00:08:00,050
So let's actually go back and say this content underline minute example and here I need to click on

130
00:08:00,050 --> 00:08:07,820
this Kilcash here and now I can't just select this horizontal scroll view and for the layout height

131
00:08:07,880 --> 00:08:10,200
again just assigned a value number 50.

132
00:08:10,280 --> 00:08:13,930
OK I can just select this and assign the value in over 50.

133
00:08:14,150 --> 00:08:17,460
And let's actually run our project again and see what happens.

134
00:08:17,660 --> 00:08:21,360
As you can see here now our application is running on the simulator.

135
00:08:21,510 --> 00:08:25,510
And here if I scroll to the left we can see these values here.

136
00:08:25,580 --> 00:08:26,890
OK.

137
00:08:26,930 --> 00:08:28,830
So hopefully that makes sense.

138
00:08:28,850 --> 00:08:34,190
And now let's actually go back inside this main activity the job of right here and here let's actually

139
00:08:34,280 --> 00:08:36,320
add some lines of code here OK.

140
00:08:36,410 --> 00:08:38,950
First of all it's actually create on my foot here.

141
00:08:38,960 --> 00:08:42,590
So here I just pasting this method and then I'll explain to you what's going on here.

142
00:08:42,590 --> 00:08:43,510
OK.

143
00:08:43,670 --> 00:08:49,510
So as you can see here this is on my foot and the Axis modifier of the Smurfette is public.

144
00:08:49,640 --> 00:08:56,210
The return type of this method is in integer and the name of this method is get the average value.

145
00:08:56,330 --> 00:08:56,980
OK.

146
00:08:57,320 --> 00:08:59,590
And here we have a special type of argument.

147
00:08:59,600 --> 00:09:03,060
OK this is actually an array of integer numbers.

148
00:09:03,290 --> 00:09:08,260
And we could actually add unlimited numbers as an argument to this effect.

149
00:09:08,300 --> 00:09:08,810
OK.

150
00:09:08,870 --> 00:09:12,170
As an argument and let's see how we can use that.

151
00:09:12,170 --> 00:09:12,530
OK.

152
00:09:12,560 --> 00:09:17,600
First of all instead of this Smurfette as you can see I actually created a variable of type integer

153
00:09:18,140 --> 00:09:23,670
and the name of the sum of it the name of this value is actually total value.

154
00:09:23,780 --> 00:09:26,890
And then I assign the value 0 to this variable OK.

155
00:09:27,230 --> 00:09:30,380
And then here I created an enhanced for loop.

156
00:09:30,650 --> 00:09:37,610
So for an inside the practices of this for loop I specified first of all I actually created a variable

157
00:09:37,610 --> 00:09:40,340
of type integer value colon numbers.

158
00:09:40,490 --> 00:09:47,980
So this value here is actually going to iterate over the values that are inside of these numbers arey.

159
00:09:48,200 --> 00:09:49,630
OK so this is very important.

160
00:09:49,670 --> 00:09:52,130
Int dot dot space numbers.

161
00:09:52,140 --> 00:09:52,670
OK.

162
00:09:52,910 --> 00:09:55,410
This is the type of our Aure Okay.

163
00:09:55,760 --> 00:09:59,040
And here when we actually we are actually going to use this method.

164
00:09:59,030 --> 00:10:02,010
Alex you how we can use these Smif at the Cape.

