1
00:00:00,270 --> 00:00:05,990
Hire everyone in this theater you're going to go ahead and create another Android application.

2
00:00:06,000 --> 00:00:06,990
So just click on this.

3
00:00:07,020 --> 00:00:15,480
Start a new Android studio project here and then for the application name just type in here app 27 and

4
00:00:15,480 --> 00:00:24,150
then click on next year's choose AP A16 Android 4.1 Jelly Bean for minimum STK click on next and here

5
00:00:24,180 --> 00:00:28,630
choose blank activity next and then actually can finish.

6
00:00:28,650 --> 00:00:29,280
OK.

7
00:00:29,550 --> 00:00:30,080
OK.

8
00:00:30,150 --> 00:00:35,550
First of all let's actually select these hello or takes you here and then press on it delete key on

9
00:00:35,550 --> 00:00:39,110
your keyboard and then double click on this arrest folder here.

10
00:00:39,360 --> 00:00:43,080
Lay out activity underline make that example OK.

11
00:00:43,320 --> 00:00:48,650
And here choose fluting action button here and then press on delete key on your keyboard.

12
00:00:48,660 --> 00:00:49,260
OK.

13
00:00:49,650 --> 00:00:55,290
So now let's actually go back inside this content underline minute made that example and then double

14
00:00:55,290 --> 00:00:58,930
click on this tab here in order to make this area wider.

15
00:00:59,010 --> 00:01:04,700
So now it is actually track linearly out vertical into these relatively out here.

16
00:01:04,710 --> 00:01:04,950
OK.

17
00:01:04,950 --> 00:01:06,600
And put it at the center OK.

18
00:01:07,080 --> 00:01:12,910
And then let's actually drag a scroll view of vertical scroll view into these linearly alphabetical

19
00:01:12,930 --> 00:01:13,510
here.

20
00:01:13,530 --> 00:01:19,620
So as you can see this is a vertical scroll view here and put it here at the center of this linear left

21
00:01:19,620 --> 00:01:20,750
vertical OK.

22
00:01:21,210 --> 00:01:27,880
And now this section is right and are there linearly out vertical into this scroll view here OK.

23
00:01:27,930 --> 00:01:31,750
So as you know scroll you can only accept one direct child.

24
00:01:32,010 --> 00:01:37,890
So if you just put in one scroll you hear and then you actually put a linearly aesthetical into this

25
00:01:37,890 --> 00:01:38,720
scroll view.

26
00:01:38,910 --> 00:01:44,620
And then when you can actually put all our components into this linearly aesthetical here.

27
00:01:44,650 --> 00:01:52,590
OK so now let's actually track a large text view into this linearly and we're still here.

28
00:01:52,680 --> 00:01:53,240
OK.

29
00:01:53,490 --> 00:01:57,900
And double click on it for the text just type in here animal.

30
00:01:58,170 --> 00:01:58,760
OK.

31
00:01:58,980 --> 00:02:02,270
And then a person Enter key on your keyboard.

32
00:02:02,580 --> 00:02:10,320
Now let's actually select this larger text view here and put it inside these linearly alphabetical here.

33
00:02:10,380 --> 00:02:17,390
Double click on it and delete the text of this text view for the ID just step in here TXI the animal.

34
00:02:17,460 --> 00:02:18,220
OK.

35
00:02:18,690 --> 00:02:21,150
And then press on Enter key on your keyboard.

36
00:02:21,480 --> 00:02:27,040
Now let's actually drag another large text view into this linearly afterwards to call here.

37
00:02:27,300 --> 00:02:27,830
OK.

38
00:02:27,960 --> 00:02:34,910
Double click on it and for the text just type in here lion and then press Enter key on your keyboard

39
00:02:35,370 --> 00:02:41,670
and then let's actually drag and another large takes you into this linearly out of vertical here and

40
00:02:41,670 --> 00:02:48,540
double click on it deletes the text of this text view for the ID just typing here takes the lion.

41
00:02:48,630 --> 00:02:49,150
OK.

42
00:02:49,200 --> 00:02:54,660
And then press Enter key on your keyboard so that it's actually and other large takes you into this

43
00:02:54,750 --> 00:02:56,590
linearly elsewhere sequel here.

44
00:02:56,640 --> 00:03:01,150
Double click on it and for the text just type in here.

45
00:03:01,390 --> 00:03:06,980
Line using polymorphism.

46
00:03:07,170 --> 00:03:07,670
OK.

47
00:03:07,770 --> 00:03:11,320
And then Persaud Enter key on your keyboard.

48
00:03:11,460 --> 00:03:12,190
OK.

49
00:03:12,350 --> 00:03:18,740
And now let's actually track another large takes you into these linearly alphabetical double click on

50
00:03:18,750 --> 00:03:20,040
it.

51
00:03:20,220 --> 00:03:21,680
Is the text of the stakes for.

52
00:03:21,720 --> 00:03:25,130
And for the idea just typing here takes the polymorphism

53
00:03:28,530 --> 00:03:32,230
OK and then a person enter the key on your keyboard.

54
00:03:32,250 --> 00:03:32,960
OK.

55
00:03:34,210 --> 00:03:38,930
So now the design of art actually to use an interface is actually finished.

56
00:03:38,950 --> 00:03:44,350
So now let's actually go back and say this main activity that you have a file here and then delete these

57
00:03:45,520 --> 00:03:50,180
deleted is lines of code that are actually related to the Options menu here.

58
00:03:50,350 --> 00:03:51,240
OK.

59
00:03:51,700 --> 00:03:56,940
And then delete this block of code that is actually related to the floating action button.

60
00:03:57,100 --> 00:04:01,060
Ok so now we don't actually put our own code here.

61
00:04:01,060 --> 00:04:08,070
OK but first of all we need to actually create some classes some Java classes here inside that project.

62
00:04:08,430 --> 00:04:12,680
OK so now let's actually create a class called animal.

63
00:04:12,850 --> 00:04:14,050
So just click on file.

64
00:04:14,170 --> 00:04:15,420
Ok new.

65
00:04:15,760 --> 00:04:18,280
And then click on Java class here.

66
00:04:18,310 --> 00:04:18,930
OK.

67
00:04:19,180 --> 00:04:25,190
And for the name just type in here any month and then click on OK here.

68
00:04:25,900 --> 00:04:32,350
Let's actually create another class for the new Jobar class for the name of the class just typing and

69
00:04:32,380 --> 00:04:33,190
chat.

70
00:04:33,590 --> 00:04:34,310
OK.

71
00:04:34,360 --> 00:04:35,390
OK.

72
00:04:35,980 --> 00:04:42,970
And it's actually create another class file new Java class here for the class name just type in here

73
00:04:43,040 --> 00:04:45,080
lion and then click on.

74
00:04:45,100 --> 00:04:45,750
OK.

75
00:04:46,150 --> 00:04:52,510
So as you can see here we created our classes here and now this actually to go back and say this animal

76
00:04:52,600 --> 00:04:57,990
that will find here and say that this animal class we can actually put in some lines of code here.

77
00:04:58,060 --> 00:04:58,470
OK.

78
00:04:58,540 --> 00:05:01,560
Let's actually declare some instance variables.

79
00:05:01,570 --> 00:05:02,230
OK.

80
00:05:02,620 --> 00:05:07,780
So as you can see here this is these are actually Lemar my instance variables that they actually declare

81
00:05:07,810 --> 00:05:08,430
here.

82
00:05:08,680 --> 00:05:13,060
So here I created I actually declared this instance variable.

83
00:05:13,090 --> 00:05:14,970
The access modifier is private.

84
00:05:15,010 --> 00:05:18,180
Actually the type of this instance valuable is strange.

85
00:05:18,370 --> 00:05:21,690
And the name of this instance variable is animal name.

86
00:05:21,730 --> 00:05:22,250
OK.

87
00:05:22,510 --> 00:05:30,410
And here if you actually declared another instance variable private string animal culture private and

88
00:05:31,030 --> 00:05:34,890
animal power and private it animals speak.

89
00:05:34,900 --> 00:05:35,170
OK.

90
00:05:35,170 --> 00:05:40,090
So not notice that I didn't actually instantiate this instance variables here.

91
00:05:40,210 --> 00:05:43,650
So I'll just declare this in these instance variables OK.

92
00:05:43,660 --> 00:05:48,770
Now let's actually create a constructor for this animal class here.

93
00:05:48,790 --> 00:05:50,180
OK so I just can't.

94
00:05:50,410 --> 00:05:54,820
I'm just going to pasting this constructor here and then I'm going to explain to you what's going on

95
00:05:54,820 --> 00:05:55,150
here.

96
00:05:55,150 --> 00:05:55,540
OK.

97
00:05:55,630 --> 00:05:58,170
So as you can see here this is my constructor.

98
00:05:58,260 --> 00:05:59,670
They actually paste that here.

99
00:05:59,770 --> 00:06:00,370
OK.

100
00:06:00,550 --> 00:06:03,700
The access modifier of this constructor is public.

101
00:06:03,700 --> 00:06:11,560
The name of this constructor must be as this in name of these actually the class must be the same as

102
00:06:11,560 --> 00:06:12,960
the name of this class name.

103
00:06:13,020 --> 00:06:17,940
Ok here I actually specify that this constructor is going to accept some arguments.

104
00:06:17,960 --> 00:06:21,740
Ok the first argument as you can see is actually of type strain.

105
00:06:21,970 --> 00:06:24,300
And the name of this argument is the money.

106
00:06:24,340 --> 00:06:25,020
OK.

107
00:06:25,450 --> 00:06:29,120
And here as you can see our second argument is actually of type.

108
00:06:29,110 --> 00:06:33,390
Strange animal culture in power in speed.

109
00:06:33,460 --> 00:06:34,110
OK.

110
00:06:34,360 --> 00:06:40,170
And here inside of these constructed here you can see that they actually created two statements here.

111
00:06:40,180 --> 00:06:40,680
OK.

112
00:06:40,690 --> 00:06:47,290
The first IF statement as you can see it says I should if the value of the power argument as you can

113
00:06:47,290 --> 00:06:55,400
see I am referring to the name of this argument here OK if power is less than or equal to number 0.

114
00:06:55,660 --> 00:06:58,060
OK then it's going I should be for an exception.

115
00:06:58,180 --> 00:07:01,200
OK fro new illegal argument.

116
00:07:01,210 --> 00:07:04,240
Exceptional case can actually prove an exception object.

117
00:07:04,280 --> 00:07:12,190
OK here as you can see this new keyboard is going to create an exception object for a new legal argument

118
00:07:12,270 --> 00:07:13,640
x exception.

119
00:07:13,660 --> 00:07:20,800
So if you actually pass a value that is less than number zero to this constructor for this exception

120
00:07:21,190 --> 00:07:24,040
and then it's going to show the text inside of the lock.

121
00:07:24,160 --> 00:07:26,360
And we can see what's what's the error.

122
00:07:26,410 --> 00:07:27,270
OK.

123
00:07:27,640 --> 00:07:29,490
Actually that the application is going to crash.

124
00:07:29,680 --> 00:07:32,040
If we actually put this line of code here.

125
00:07:32,140 --> 00:07:37,800
OK but I just wanted to show you how you can use actual exceptions in your projects.

126
00:07:37,810 --> 00:07:45,870
And here it says again if the value of this speed variable is less than or equal to number 0 again fro

127
00:07:46,120 --> 00:07:52,380
new illegal argument exception the value of speed must be greater than number 0.

128
00:07:52,510 --> 00:07:53,190
OK.

129
00:07:53,470 --> 00:07:59,890
And then here I am actually instantiating these instance variables that I actually created inside this

130
00:07:59,940 --> 00:08:00,960
animal class.

131
00:08:01,100 --> 00:08:03,300
Does that animal name.

132
00:08:03,310 --> 00:08:06,870
Here I am referring to this animal named instance valuable.

133
00:08:06,870 --> 00:08:10,500
Does that animal name assignment operator animal.

134
00:08:10,630 --> 00:08:14,130
Ok I am referring to this animal name argument here.

135
00:08:14,140 --> 00:08:19,950
As you can see and here I am actually referring to the name of this animal color instance variable.

136
00:08:20,020 --> 00:08:24,790
Does that animal color assignment operator animal color.

137
00:08:24,820 --> 00:08:27,940
Here you can see I am referring to the name of this argument.

138
00:08:28,060 --> 00:08:31,510
Does that animal power instance valuable here.

139
00:08:31,760 --> 00:08:35,000
Assignment operator power argument.

140
00:08:35,010 --> 00:08:35,820
OK.

141
00:08:36,120 --> 00:08:44,070
And here I am actually typing I actually referred to the name of this instance variable does that animal

142
00:08:44,070 --> 00:08:46,830
speed assignment operator speed.

143
00:08:46,980 --> 00:08:50,330
OK so hopefully that makes sense.

144
00:08:50,370 --> 00:08:54,570
Now there's actually some more lines of code here inside of this class.

145
00:08:54,570 --> 00:09:01,070
So now let's actually create some getters and setters for these instance variables.

146
00:09:01,350 --> 00:09:06,880
So here instead of this animal class as you can see here I can just right right click here.

147
00:09:06,900 --> 00:09:07,440
OK.

148
00:09:07,680 --> 00:09:12,060
And then click on generate as you can see here this is generate here.

149
00:09:12,180 --> 00:09:16,420
You can actually hold the command key and then present an OK.

150
00:09:16,980 --> 00:09:22,500
And then here as you can see here and actually create get here set here or I can actually create getters

151
00:09:22,530 --> 00:09:23,520
and setters.

152
00:09:23,550 --> 00:09:30,150
So I just just click on this get here and sit here and then hit as you can see these are our own instance

153
00:09:30,150 --> 00:09:33,120
variables that we created inside of this class.

154
00:09:33,120 --> 00:09:37,220
So just select all of these instance variables here.

155
00:09:37,290 --> 00:09:37,860
OK.

156
00:09:37,920 --> 00:09:39,510
And then click on OK.

157
00:09:39,720 --> 00:09:46,160
So now as you can see the ID actually created these getters and setters automatically for us.

158
00:09:46,170 --> 00:09:53,280
OK you can see this good animal name said animal name good animal Codder are set animal color gets animal

159
00:09:53,280 --> 00:09:58,500
power to sit animal power with animals speed and animal speed here.

160
00:09:58,600 --> 00:09:58,900
OK.

