1
00:00:00,400 --> 00:00:05,910
Hire everyone in this theater you are really going to go ahead and actually create our seventh Android

2
00:00:05,910 --> 00:00:06,900
application.

3
00:00:06,900 --> 00:00:07,850
So just click on this.

4
00:00:07,860 --> 00:00:15,930
Start a new Android studio project and for the application name just type in here app 7 and then click

5
00:00:15,930 --> 00:00:25,480
on next and then choose the output API 16:4 your minimum STK next and black Planche activity next.

6
00:00:25,740 --> 00:00:27,270
And here click on finish.

7
00:00:27,450 --> 00:00:28,270
OK everyone.

8
00:00:28,350 --> 00:00:31,240
Now as you can see here our project is created.

9
00:00:31,440 --> 00:00:37,080
So let's just delete this hello or text you here and then let's just actually delete these floating

10
00:00:37,110 --> 00:00:38,280
action button here.

11
00:00:38,340 --> 00:00:44,520
So double click on this address for the here and then lay out and then double double click on this activity

12
00:00:44,520 --> 00:00:45,950
on the line made that example.

13
00:00:46,140 --> 00:00:48,530
And here's the list these are floating action button here.

14
00:00:48,540 --> 00:00:49,200
OK.

15
00:00:49,770 --> 00:00:55,660
So now let's actually go back and say this content underline made that example and then dragging a linear

16
00:00:55,910 --> 00:00:57,460
layout vertical OK.

17
00:00:57,660 --> 00:01:01,140
Inside this screen and in the center of the screen.

18
00:01:01,410 --> 00:01:07,200
So let's actually click on this relatively out here and let's actually find the padding attributes for

19
00:01:07,200 --> 00:01:12,140
this relatively out and for the are actually assigned number 0.

20
00:01:12,900 --> 00:01:19,410
And here as you can see now the beats at the height of R are linearly Ellsworth's the code is actually

21
00:01:19,410 --> 00:01:21,270
covering the the entire screen.

22
00:01:21,270 --> 00:01:21,950
OK.

23
00:01:22,320 --> 00:01:28,710
So let's actually try again a text you are large takes you into this linearly out here and then actually

24
00:01:28,710 --> 00:01:30,130
double click on this text.

25
00:01:30,380 --> 00:01:35,490
And for the text you can just assign a text here for example.

26
00:01:35,490 --> 00:01:44,500
For example you can just put in start and for the ID just type in here to the start.

27
00:01:45,420 --> 00:01:48,230
And let's actually dragging about in here.

28
00:01:48,780 --> 00:01:55,060
So let's just find the bottom component here and then break it here and double click on the spot.

29
00:01:55,320 --> 00:02:07,410
And for the text just typing here start the loop and for the ID just type in between loop and as you

30
00:02:07,410 --> 00:02:11,640
can see here I want to actually put a space between these two components.

31
00:02:11,670 --> 00:02:17,550
This takes you on the spot and again just dragging on top a large takes you here in between these two

32
00:02:17,550 --> 00:02:18,860
components.

33
00:02:19,090 --> 00:02:26,400
I can just delete the text of this text you and then I can just find the Margene attribute for this

34
00:02:26,400 --> 00:02:27,470
takes you here.

35
00:02:27,480 --> 00:02:34,100
So as you can see this is the margin attribute and for the margin I can just assign number 20 here.

36
00:02:34,110 --> 00:02:37,590
So as you can see there is a difference between these two components here.

37
00:02:37,590 --> 00:02:38,080
OK.

38
00:02:38,400 --> 00:02:41,610
So now let's actually go inside this main activity that you will find here.

39
00:02:41,820 --> 00:02:44,970
And let's actually delete these lines of code here.

40
00:02:45,050 --> 00:02:49,830
It is lines of code too because these are actually related to the floating action button.

41
00:02:50,220 --> 00:03:04,030
And here let's actually create a text view object text through the XTi start and then I can just cast

42
00:03:04,030 --> 00:03:06,520
this object to a text view object.

43
00:03:07,380 --> 00:03:07,980
OK.

44
00:03:08,000 --> 00:03:25,750
Find you by ID are that Id dot the X the start and the button button and loop assignment operator button

45
00:03:27,800 --> 00:03:33,790
find you by ID or that Id dot PTEN loop.

46
00:03:33,920 --> 00:03:39,710
So now let's actually make it important to listen to the clicks that the user make.

47
00:03:40,070 --> 00:03:48,970
So I can't just type in PTEN loop that set and click listen a new view that actually listen or OK.

48
00:03:49,340 --> 00:03:53,910
So now here let's actually create a for loop in this tutorial.

49
00:03:53,960 --> 00:03:58,970
I want to actually show you the full up how you can actually create four loops in Java so I can just

50
00:03:58,970 --> 00:04:05,150
type in four and then I can actually put in a pair of round brackets here and then in order to start

51
00:04:05,150 --> 00:04:11,460
the loop I can't just create a variable here so I can't just take it in ain't I.

52
00:04:11,600 --> 00:04:13,140
Assignment operator zero.

53
00:04:13,370 --> 00:04:16,660
So as you can see here first of all I actually created a valuable.

54
00:04:16,930 --> 00:04:17,170
OK.

55
00:04:17,180 --> 00:04:20,470
And then I assign numbers not numbers 0 to this value.

56
00:04:20,500 --> 00:04:20,810
OK.

57
00:04:20,810 --> 00:04:26,690
Now I need to actually specify when my loop is going to is going to end.

58
00:04:26,960 --> 00:04:33,770
So I can just type in until I is listable equal to number 10 and then I need to put in a semicolon here

59
00:04:34,310 --> 00:04:40,730
and in here I need to actually specify that what happens whenever this loop executes.

60
00:04:40,780 --> 00:04:42,660
You want the value of this.

61
00:04:42,830 --> 00:04:48,120
Are you valuable to actually to be increased by 1.

62
00:04:48,620 --> 00:04:49,380
OK.

63
00:04:49,880 --> 00:04:53,180
And then I need to open and close this two for using these curly braces.

64
00:04:53,180 --> 00:04:58,390
So here I can just type in the start that said text.

65
00:04:58,400 --> 00:05:05,930
And now inside the practice's I can just refer to the name of this variable.

66
00:05:06,800 --> 00:05:10,030
And then because this is actually of type Integer.

67
00:05:10,160 --> 00:05:17,030
And and here we're are actually assigning an integer number to this at the start of we need to actually

68
00:05:17,360 --> 00:05:24,200
convert this value to a string value by actually putting a plus operator and then or two or two double

69
00:05:24,200 --> 00:05:24,810
quotes here.

70
00:05:24,850 --> 00:05:29,060
OK so now let's actually run our application and see what happens.

71
00:05:29,060 --> 00:05:31,550
So now as you can see our application is running.

72
00:05:31,790 --> 00:05:36,940
And if I click on the spot in here as you can see it says number 10.

73
00:05:37,130 --> 00:05:37,590
OK.

74
00:05:37,730 --> 00:05:43,750
When I click on this button here OK this loop is going to be executed 10 times.

75
00:05:43,760 --> 00:05:44,280
OK.

76
00:05:44,570 --> 00:05:51,260
First we actually specified are valuable and then we specified in our loop is going to end actually

77
00:05:51,560 --> 00:05:56,110
until it is less than or equal to number 10 and plus plus.

78
00:05:56,150 --> 00:06:02,780
And here in this piece of code actually specifies what happens after each execution of a for loop or

79
00:06:02,780 --> 00:06:04,720
this piece of code is going to be executed.

80
00:06:04,740 --> 00:06:06,070
A-plus plus.

81
00:06:06,110 --> 00:06:06,440
OK.

82
00:06:06,500 --> 00:06:08,670
So as you can see Number 10 is here.

83
00:06:09,070 --> 00:06:09,670
OK.

84
00:06:10,040 --> 00:06:12,360
So now I want to show you the while loop.

85
00:06:12,380 --> 00:06:15,160
So now let's actually comment out these lines of code here.

86
00:06:15,200 --> 00:06:16,040
OK everyone.

87
00:06:16,160 --> 00:06:22,430
Now I want to talk about why loop so I can just type in a while and then I put a pair of round brackets

88
00:06:22,550 --> 00:06:29,480
here and now I need to actually specify the condition in which the divide is going to be executed.

89
00:06:29,480 --> 00:06:33,510
So first let me actually create a variable here ain't I.

90
00:06:33,710 --> 00:06:37,890
And then I actually assign a value to my valuable.

91
00:06:37,910 --> 00:06:39,390
For example number zero.

92
00:06:39,740 --> 00:06:48,140
And here in say the prentices I can just type in I is less than or equal to number two number 10.

93
00:06:48,400 --> 00:06:48,730
OK.

94
00:06:48,740 --> 00:06:53,950
And then I need to actually open and close my while loop by using these curly braces.

95
00:06:54,350 --> 00:07:00,130
So as you can see here first of all I actually created a variable of type integer and then inside the

96
00:07:00,130 --> 00:07:06,500
parentheses here I actually specified very my while loop is going to be and that OK.

97
00:07:06,680 --> 00:07:14,450
And now inside these are curly braces I need to actually specify what's going to happen in each execution

98
00:07:14,450 --> 00:07:15,640
of this while loop.

99
00:07:15,650 --> 00:07:22,650
So now I can just type in to the start that said text and then say the prentices.

100
00:07:22,790 --> 00:07:28,400
OK just leave it with the name of this I are valuable here plus two double quotes.

101
00:07:28,520 --> 00:07:34,450
OK here I am actually converting this value bet the value of this variable to a string value.

102
00:07:34,790 --> 00:07:43,970
And now we need to actually increase the value of this variable by one in each execution of these two.

103
00:07:44,030 --> 00:07:44,850
OK so I.

104
00:07:44,870 --> 00:07:46,400
Plus plus.

105
00:07:46,460 --> 00:07:49,130
So let's run our project and see what happens.

106
00:07:49,130 --> 00:07:57,340
So now if you actually click on this pattern here start the loop as you can see it says Number 10.

107
00:07:57,660 --> 00:07:59,080
OK here it's going.

108
00:07:59,100 --> 00:08:02,600
It is actually executing this while loop 10 times.

109
00:08:02,600 --> 00:08:03,280
OK.

110
00:08:03,520 --> 00:08:08,480
And then it is actually executing these lines of code in the inside of this while loop.

111
00:08:08,660 --> 00:08:09,380
OK.

112
00:08:09,590 --> 00:08:13,570
So this is how you actually create a while loop in your project.

113
00:08:13,610 --> 00:08:14,180
OK.

114
00:08:14,360 --> 00:08:19,560
So now I want one actually talk about the do while loop.

115
00:08:19,760 --> 00:08:20,250
OK.

116
00:08:20,330 --> 00:08:26,800
So first let me actually comment out these lines of code here and now I again just type in.

117
00:08:26,920 --> 00:08:27,780
OK.

118
00:08:28,180 --> 00:08:32,700
And then I actually open and close my statement here by using these curly braces.

119
00:08:32,710 --> 00:08:39,400
And then here at the end of this ending curly brace I can just type in wide and then I need to put in

120
00:08:39,730 --> 00:08:43,150
a pair of round brackets after my white statement here.

121
00:08:43,150 --> 00:08:43,590
OK.

122
00:08:43,700 --> 00:08:45,160
That is why we're here.

123
00:08:45,310 --> 00:08:48,770
And then inside of this prentices I can specify the condition.

124
00:08:48,900 --> 00:08:50,330
Ok for example.

125
00:08:50,740 --> 00:08:55,840
First let me actually create another variable for example in y.

126
00:08:56,230 --> 00:09:00,860
Assignment operator zero and here here just specify the condition.

127
00:09:01,030 --> 00:09:06,200
So I can't just typing until Y is less than or equal to number 15.

128
00:09:06,600 --> 00:09:07,230
OK.

129
00:09:07,390 --> 00:09:11,100
And then I need to actually putting a semi-colon at the end of my statement.

130
00:09:11,140 --> 00:09:19,270
So now I get it here I get inside this do our statement here I can't just typing in the start that said

131
00:09:19,270 --> 00:09:24,510
text y ok.

132
00:09:25,010 --> 00:09:35,210
And then I need to actually increase the value of this variable by 1 in each execution of these do while

133
00:09:35,210 --> 00:09:36,350
loop.

134
00:09:36,350 --> 00:09:39,050
So now let's actually run our project and see what happens.

135
00:09:39,230 --> 00:09:39,800
OK.

136
00:09:39,890 --> 00:09:41,490
Now let's actually click on this.

137
00:09:41,500 --> 00:09:43,800
Start the loop plotted here.

138
00:09:45,140 --> 00:09:49,280
And as you can see here our application crashed as you can see.

139
00:09:49,460 --> 00:09:57,560
The problem is we didn't actually convert this up valuable to a string value by using these but using

140
00:09:57,560 --> 00:09:58,510
this plus operation.

141
00:09:58,520 --> 00:10:03,490
And then these two are double quotes and let's actually do our project again.

