1
00:00:00,200 --> 00:00:06,680
Hire everyone in this theater you are going to go ahead and create our 14th Android application.

2
00:00:06,870 --> 00:00:07,860
So just click on this.

3
00:00:07,860 --> 00:00:10,000
Start in your Android studio project.

4
00:00:10,110 --> 00:00:17,340
And here we need to actually specify our name for our application app 14 and you can actually specify

5
00:00:17,340 --> 00:00:21,230
the company domain package name and project location.

6
00:00:21,270 --> 00:00:26,710
Click next and here choose API 16 Android 4.1 jellybean.

7
00:00:26,990 --> 00:00:30,310
OK click clicking next blank activity.

8
00:00:30,660 --> 00:00:33,490
Next And here don't change anything.

9
00:00:33,510 --> 00:00:35,000
And then we can finish here.

10
00:00:35,010 --> 00:00:37,390
Delete this hello or text view.

11
00:00:37,800 --> 00:00:43,500
And then double click on the rest folder and lay out and then double click on the activity on the line

12
00:00:43,500 --> 00:00:49,110
main and then select this fluting action button and then press delete key on your keyboard.

13
00:00:49,110 --> 00:00:50,020
OK.

14
00:00:50,310 --> 00:00:54,280
So let's go back inside this content on the line of the example.

15
00:00:54,420 --> 00:00:57,530
And here we can actually design our user interface.

16
00:00:57,540 --> 00:00:57,970
Ok.

17
00:00:58,020 --> 00:00:58,870
Ok everyone.

18
00:00:58,980 --> 00:01:04,200
Now let's actually track our linear layout vertical into this relatively alloca.

19
00:01:04,200 --> 00:01:08,840
So let's just drag it at the center of the are relatively OK.

20
00:01:08,940 --> 00:01:14,180
At the center of the screen and as you can see here these are linearly at vertical.

21
00:01:14,340 --> 00:01:20,590
So now it's actually dreich are linearly out horizontal into this linear layout vertical OK.

22
00:01:20,940 --> 00:01:23,720
So these are linearly out horizontal.

23
00:01:23,880 --> 00:01:31,080
And now let's actually track two large takes views into this linearly or horizontal that is inside of

24
00:01:31,080 --> 00:01:32,860
this linear left vertical.

25
00:01:33,110 --> 00:01:33,600
OK.

26
00:01:33,690 --> 00:01:36,070
So double click and these are large text view.

27
00:01:36,450 --> 00:01:39,100
And for the text just type in here.

28
00:01:39,210 --> 00:01:44,680
Total value of the array.

29
00:01:46,560 --> 00:01:47,210
OK.

30
00:01:47,460 --> 00:01:50,090
And as you can see here this is our value here.

31
00:01:50,400 --> 00:01:56,460
And now let's actually track and others takes you into this linear layout horizontal select this large

32
00:01:57,150 --> 00:02:04,860
text and then I put it inside these linearly and horizontal and double click on it and delete the text

33
00:02:04,860 --> 00:02:06,680
of this text view.

34
00:02:07,260 --> 00:02:11,030
And for the idea Id just type in here takes the total.

35
00:02:11,230 --> 00:02:12,140
OK.

36
00:02:12,810 --> 00:02:19,640
And as you can see here these are our two text views that are actually inside of these linearly and

37
00:02:19,650 --> 00:02:20,330
horizontal.

38
00:02:20,330 --> 00:02:28,020
OK so now let's assume that the weight of this linearly and horizontal is 100.

39
00:02:28,090 --> 00:02:35,750
OK so now I want to actually allocate 80 percent of the width of these linearly at horizontal to this

40
00:02:35,870 --> 00:02:40,100
it takes you here OK total by the total value of the array.

41
00:02:40,110 --> 00:02:47,250
So here for the width of this takes you just assign the value 0 and for the weight of this text view

42
00:02:47,670 --> 00:02:50,690
for the length of 8 assigned the value 80.

43
00:02:51,030 --> 00:02:53,030
So let me explain again.

44
00:02:53,040 --> 00:02:58,500
I assumed that the weight of these are linearly held horizontally is 100.

45
00:02:58,500 --> 00:02:58,780
OK.

46
00:02:58,800 --> 00:03:06,570
And I want to actually allocate 80 percent of the weight of this linearly or horizontal to the weight

47
00:03:06,660 --> 00:03:10,200
of this a total value of the Great Lakes view OK.

48
00:03:10,260 --> 00:03:15,380
So I actually assigned the value 0 to the of which of these takes you.

49
00:03:15,480 --> 00:03:19,460
And then I assign the value 80 to the left rate of the sticks.

50
00:03:19,470 --> 00:03:20,120
OK.

51
00:03:20,490 --> 00:03:23,930
So here now we have 20 percent left.

52
00:03:23,970 --> 00:03:24,390
OK.

53
00:03:24,420 --> 00:03:30,440
20 percent of the lay out of the way of these are linearly or isn't what is left.

54
00:03:30,600 --> 00:03:37,200
OK so now let's actually get the value 0 to the lay out which of these takes the total takes view.

55
00:03:37,390 --> 00:03:38,220
OK.

56
00:03:38,810 --> 00:03:45,270
And assign the value 20 to deliberate rate of this takes you.

57
00:03:45,460 --> 00:03:52,570
So as you can see here now this takes you is actually taking 20 percent of the vote of this linearly

58
00:03:52,620 --> 00:03:54,040
and horizontal Okay.

59
00:03:54,630 --> 00:04:02,040
So this is our linearly or horizontal and we assumed that the weight of these artists is 100.

60
00:04:02,140 --> 00:04:02,800
OK.

61
00:04:03,010 --> 00:04:04,510
One hundred percent.

62
00:04:04,800 --> 00:04:11,100
And we gave 80 percent of the base of this linearly or horizontal to this text view here total value

63
00:04:11,100 --> 00:04:16,750
of the array and I assign the value 0 to the level to which of the state's view.

64
00:04:16,860 --> 00:04:21,020
And then I assign the value 80 to the weight of the sticks.

65
00:04:21,450 --> 00:04:25,700
And here I actually assigned the value 0 to the left.

66
00:04:25,710 --> 00:04:31,770
Which of these takes you and I assign the value 20 to the left rate of this takes you OK.

67
00:04:31,830 --> 00:04:33,850
So hopefully that makes sense.

68
00:04:34,080 --> 00:04:39,370
And let's actually track another linearly or horizontal into this linearly alphabetical.

69
00:04:39,490 --> 00:04:40,530
Okay.

70
00:04:40,720 --> 00:04:48,310
So let's actually select this linearly and horizontal and then put it inside this linearly and vertical

71
00:04:48,940 --> 00:04:49,530
OK.

72
00:04:49,620 --> 00:04:54,480
And let's actually do a large text view into this linearly and horizontal OK.

73
00:04:54,690 --> 00:05:01,100
You can either put it here or get inside this layout or you can actually inside this component restriction.

74
00:05:01,210 --> 00:05:05,340
Again just put it here inside this linearly out horizontal OK.

75
00:05:06,030 --> 00:05:08,760
And now that's actually double click.

76
00:05:08,790 --> 00:05:11,750
And these are text view for the text.

77
00:05:11,880 --> 00:05:13,920
Just delete the text of this text view.

78
00:05:14,220 --> 00:05:18,570
And for the ID just type in here DXi triangulations.

79
00:05:18,680 --> 00:05:25,840
OK I want are these tactics the calculation takes you to be at the center of this linearly or horizontal.

80
00:05:25,980 --> 00:05:31,950
So I just need to clear this linearly at horizontal and then I can just find the gravity attribute here.

81
00:05:31,950 --> 00:05:32,720
As you can see.

82
00:05:32,910 --> 00:05:39,010
So I just need to check this check box here that says Center underline horizontal OK.

83
00:05:39,240 --> 00:05:44,530
So if I select this takes you now as you can see this text view is at the center of this linearly out

84
00:05:44,620 --> 00:05:45,790
horizontal OK.

85
00:05:45,930 --> 00:05:49,820
It is actually positioned at the center of this linearly and horizontal.

86
00:05:49,910 --> 00:05:55,710
So now let's actually go back and say this main activity that I will find here again delete these lines

87
00:05:55,710 --> 00:05:59,230
of code that are actually related to the options menu here.

88
00:05:59,580 --> 00:06:03,760
This block of code that is actually related to the to the floating action button.

89
00:06:04,050 --> 00:06:07,310
And now we can actually put our own code here.

90
00:06:07,320 --> 00:06:07,890
OK.

91
00:06:07,920 --> 00:06:10,440
Now inside these are uncreate Smurfette.

92
00:06:10,530 --> 00:06:12,990
Actually create two text view objects.

93
00:06:12,990 --> 00:06:18,720
So I just need to refer to the name of the text your class DX the total

94
00:06:21,590 --> 00:06:27,900
OK assignment operator and then I need to actually cast this object to take textbook object find view

95
00:06:27,940 --> 00:06:38,760
by id artist or E.T. that takes the total OK and this actually create another text object to the calculations

96
00:06:40,640 --> 00:06:41,280
OK.

97
00:06:41,290 --> 00:06:42,500
Assignment operator.

98
00:06:42,730 --> 00:06:51,120
And then here I need to cast this object to test your object find view by ID or thought Id dot the calculation.

99
00:06:51,140 --> 00:06:52,140
Okay.

100
00:06:53,050 --> 00:07:02,950
And here let's actually create a string object all text and I don't want to actually insensate this

101
00:07:02,950 --> 00:07:03,810
object here.

102
00:07:03,910 --> 00:07:07,690
So now this actually creates an array of integer numbers.

103
00:07:07,780 --> 00:07:11,660
So I just need to refer to the name of the integer primitive data type.

104
00:07:11,800 --> 00:07:12,390
OK.

105
00:07:12,550 --> 00:07:16,960
And then I want to actually specify that I am going to actually and then I need to actually specify

106
00:07:16,960 --> 00:07:24,130
that I am going to actually create an integer Ali by putting a pair of brackets after my type and then

107
00:07:24,370 --> 00:07:26,710
I need to actually give a name to this array.

108
00:07:26,710 --> 00:07:35,170
So I just need to type in here integer array and then I put an assignment operator here and now I want

109
00:07:35,170 --> 00:07:37,300
to actually instantiate this array.

110
00:07:37,330 --> 00:07:45,070
So I just put in a pair of curly braces here and then I will actually specify my values that I want

111
00:07:45,070 --> 00:07:46,490
to actually assign to this address.

112
00:07:46,510 --> 00:07:47,110
OK.

113
00:07:47,440 --> 00:08:03,440
So here for example Number 2 54 54 76 23 and 4 7 8 6 4 and 65.

114
00:08:03,720 --> 00:08:04,430
OK.

115
00:08:05,080 --> 00:08:11,330
And now I can actually put a semicolon at the end of my statement here.

116
00:08:11,800 --> 00:08:22,180
And let's actually create an integer variable in total value assigning number 0 to this variable and

117
00:08:22,240 --> 00:08:24,120
essentially create a for loop here.

118
00:08:24,130 --> 00:08:29,110
OK for each index.

119
00:08:29,750 --> 00:08:30,180
OK.

120
00:08:30,250 --> 00:08:33,110
And then I assign number 0 to this variable.

121
00:08:33,250 --> 00:08:38,950
And then here I need to actually specify a condition in which this loop is going to be executed until

122
00:08:38,950 --> 00:08:42,360
index is less than integer array.

123
00:08:43,000 --> 00:08:45,270
OK that length.

124
00:08:45,670 --> 00:08:48,450
And now I need to actually specify that.

125
00:08:48,580 --> 00:08:55,050
And here I need to actually specify that after each execution of this for a loop the value of this index

126
00:08:55,060 --> 00:08:59,230
variable is going to be incremented by 1 index plus plus.

127
00:08:59,560 --> 00:09:03,910
And then I need to actually open and closed this for loop by using these curly braces.

128
00:09:03,910 --> 00:09:10,270
And here I want to actually add the values of the integer array together and then I want to assign that

129
00:09:10,270 --> 00:09:11,600
value to the total value.

