1
00:00:00,420 --> 00:00:07,010
So now as you can see here our application is running on this emulator and now I want to click on these

2
00:00:07,410 --> 00:00:10,410
settings button here this spitting image.

3
00:00:10,410 --> 00:00:15,210
Now as you can see I actually transitioned to this activity settings activity right.

4
00:00:15,420 --> 00:00:21,390
And now I can see these options these items so I can actually change the number of guesses.

5
00:00:21,390 --> 00:00:27,890
So as you can see we have a typo here and I can actually it for example the animal is the type of anemones

6
00:00:27,900 --> 00:00:30,450
that I want to include in say the keys.

7
00:00:30,510 --> 00:00:38,640
I can actually change the background color or I can actually change the font of the texts of the buttons

8
00:00:38,640 --> 00:00:40,210
that we have in say the quiz.

9
00:00:40,260 --> 00:00:48,840
But for now we cannot actually change the settings because we haven't added that logic in order to actually

10
00:00:48,840 --> 00:00:51,350
interact with these items.

11
00:00:51,410 --> 00:00:57,360
Now as you can see at the top inside this action bar here we have dispatched button and now as you can

12
00:00:57,360 --> 00:00:59,800
see we transitioned to this main activity.

13
00:00:59,830 --> 00:01:03,150
And here you can see now we can actually play with the squeeze.

14
00:01:03,210 --> 00:01:11,820
So now let's actually go inside the Android studio and now let's actually go inside its main activity

15
00:01:11,820 --> 00:01:13,000
AFFREIGHTMENT here.

16
00:01:13,140 --> 00:01:15,750
So just double click and is main activity fragment.

17
00:01:16,020 --> 00:01:18,840
And now just double click on this tab here.

18
00:01:18,840 --> 00:01:23,120
Main activity fragment that Jobab in order to make this area wider.

19
00:01:23,160 --> 00:01:30,060
So here we are going to actually put some lines of code here inside this mine activity Fleischman class.

20
00:01:30,060 --> 00:01:30,590
OK.

21
00:01:30,750 --> 00:01:35,580
As you can see this main activity fragment is actually extending from this fragment.

22
00:01:35,670 --> 00:01:36,280
Right.

23
00:01:36,360 --> 00:01:40,740
So now I'm going to paste in some lines of code here inside this class and then I'm going to explain

24
00:01:40,740 --> 00:01:42,810
to you what's going on here.

25
00:01:42,900 --> 00:01:48,020
So as you can see here these are the lines of code that I pasted here.

26
00:01:48,210 --> 00:01:53,340
So in line number 24 we have this a value bet actually.

27
00:01:53,490 --> 00:01:56,620
So private static final INT.

28
00:01:56,640 --> 00:02:03,640
So this is actually a constant and the name of this constant is animals included inquiries.

29
00:02:03,660 --> 00:02:04,070
OK.

30
00:02:04,140 --> 00:02:12,280
So we can actually change this name to number number of animals included inquiries.

31
00:02:12,300 --> 00:02:19,230
So I decided to assign the value number 10 here you can assign any values that you want.

32
00:02:19,230 --> 00:02:22,210
So this constant is going to determine that.

33
00:02:22,320 --> 00:02:26,630
How many are animals that we've actually put inside our quiz.

34
00:02:26,730 --> 00:02:31,530
So I decided to assign the value number 10 in line number 26.

35
00:02:31,530 --> 00:02:38,160
We have a private list and this list actually accepts values of type stream.

36
00:02:38,250 --> 00:02:39,140
Right.

37
00:02:39,230 --> 00:02:47,020
And now as you can see here lists are actually like arrays we can assign arrays to this list.

38
00:02:47,190 --> 00:02:47,650
Right.

39
00:02:47,760 --> 00:02:51,270
But our list is actually on an interface in Java.

40
00:02:51,600 --> 00:02:59,500
And this list interface has more functions or methods that we can actually use for our own good.

41
00:02:59,520 --> 00:03:07,020
So that's why I actually use list instead of three or at least here and now you can see that we can

42
00:03:07,020 --> 00:03:15,450
actually assign Ariz to this list and we can actually take advantage of the methods that we have inside

43
00:03:15,450 --> 00:03:17,050
this list interface.

44
00:03:17,310 --> 00:03:26,900
So we have a list of string values and the name of this list is all animals names list right and line

45
00:03:26,910 --> 00:03:33,540
number 27 we have another list which is actually private which accepts values of types stream and the

46
00:03:33,540 --> 00:03:43,210
name of this list is animals names quizz least as you can see here and here in line number 28.

47
00:03:43,230 --> 00:03:46,200
We have another private set here.

48
00:03:46,200 --> 00:03:47,980
We have set here this time.

49
00:03:48,150 --> 00:03:56,020
So again our set is actually an interface that can not have duplicate its values.

50
00:03:56,130 --> 00:04:01,860
So we cannot actually assign duplicated values to set or set is like a list.

51
00:04:01,890 --> 00:04:02,390
OK.

52
00:04:02,430 --> 00:04:06,610
We can actually assign an array of values to this set.

53
00:04:06,720 --> 00:04:08,900
OK this is actually an interface right.

54
00:04:08,940 --> 00:04:15,840
And as I said before because this is actually an interface we can actually use the methods that we have

55
00:04:15,840 --> 00:04:21,630
inside this interface so we can assign an array to the set and we can take advantage of the methods

56
00:04:21,660 --> 00:04:22,620
of this interface.

57
00:04:22,620 --> 00:04:25,500
So this is a really good feature of java.

58
00:04:25,830 --> 00:04:33,420
So again let me tell you that a set is actually like an array but you cannot design duplicated values

59
00:04:33,420 --> 00:04:34,540
to a set.

60
00:04:34,740 --> 00:04:37,010
So private set that accepts std.

61
00:04:37,200 --> 00:04:41,830
String values and then Aimee's animal types inquiries.

62
00:04:41,880 --> 00:04:45,710
And we have another string value thing valuable here.

63
00:04:45,720 --> 00:04:51,420
As you can see private streams and the name is correct and commands answer right.

64
00:04:51,420 --> 00:04:55,700
So this is going to be the message that we want to show to the user Whenever to use that actually our

65
00:04:56,050 --> 00:04:59,810
is that the animal name right.

66
00:04:59,910 --> 00:05:06,240
And in line number of 30 as you can see here we have a valuable and this is actually private integer

67
00:05:06,240 --> 00:05:09,630
number of all guesses in line number 31.

68
00:05:09,630 --> 00:05:15,720
We have another valuable integer number of right answers line number 42.

69
00:05:15,720 --> 00:05:20,010
We have another variable integer number of animals.

70
00:05:20,140 --> 00:05:21,010
Yes rows.

71
00:05:21,180 --> 00:05:25,890
So we will be using these valuables here inside our code.

72
00:05:25,890 --> 00:05:30,290
But here I just want to actually show you and I just I just want to introduce you.

73
00:05:30,300 --> 00:05:34,950
It is really bells and later you will see that how we can actually use these valuables.

74
00:05:35,190 --> 00:05:39,900
So a number of animals Jethro's in line number first free as you can see here.

75
00:05:40,140 --> 00:05:43,960
We have actually a secure random number.

76
00:05:44,010 --> 00:05:51,550
So here we have a valuable type secure random that can actually hold values of type secure and that

77
00:05:51,600 --> 00:05:57,470
and the name of this variable is secure random number right in line number 44.

78
00:05:57,480 --> 00:06:02,170
As you can see here we have another variable which is actually handler.

79
00:06:02,310 --> 00:06:02,790
OK.

80
00:06:02,940 --> 00:06:05,340
And the name of this variable is handler.

81
00:06:05,520 --> 00:06:12,180
So literally you will see that are going to use this handler in order to actually transition between

82
00:06:12,510 --> 00:06:13,290
the question.

83
00:06:13,290 --> 00:06:16,380
So for example let me show you the emulator.

84
00:06:16,560 --> 00:06:21,130
So as you can see here now our application is running on this emulator.

85
00:06:21,480 --> 00:06:22,960
And here we can see that.

86
00:06:23,020 --> 00:06:27,840
And I actually for example say beer and here it says bear.

87
00:06:27,960 --> 00:06:34,200
And now it waits to want one or two seconds and then the next Actually question appears here.

88
00:06:34,200 --> 00:06:36,360
The next image or the next question.

89
00:06:36,360 --> 00:06:42,680
So for example if you have a snake here and if I select a here now as I can see it weights a one second

90
00:06:43,050 --> 00:06:45,350
and then the next question appears.

91
00:06:45,360 --> 00:06:49,430
So we use this handler in order to do that job for us.

92
00:06:49,470 --> 00:06:55,110
So that's why they actually created this handler here a line number 45 as you can see here.

93
00:06:55,290 --> 00:06:57,700
We have this animation.

94
00:06:57,960 --> 00:07:02,340
So now we have a variable that actually holds the run and set animation.

95
00:07:02,340 --> 00:07:08,230
So for example if we actually select Dolfin here now as you can see here this animation is occurring

96
00:07:08,240 --> 00:07:08,640
here.

97
00:07:08,640 --> 00:07:16,080
So we use this but in order to hold that animation and use it whenever I want in line number 37 as you

98
00:07:16,080 --> 00:07:22,950
can see here we have this linearly out of body able of linearly out and the name of this valuable is

99
00:07:23,360 --> 00:07:25,860
animalcules linearly out right.

100
00:07:25,890 --> 00:07:31,500
So we use these are linearly out in order to actually for example change the background color of the

101
00:07:32,190 --> 00:07:32,760
device.

102
00:07:32,760 --> 00:07:37,470
For example if I click on the settings spot in here and if I select is truth by going uncolored for

103
00:07:37,470 --> 00:07:42,480
example if I change it to read and if I click on this box to put in here now as you can see here the

104
00:07:42,480 --> 00:07:45,990
baculum column of this linear level is red.

105
00:07:46,440 --> 00:07:50,910
So I created this linearly out here in order to actually do that job.

106
00:07:51,240 --> 00:07:52,730
We have a taste of.

107
00:07:52,830 --> 00:07:53,830
The question number.

108
00:07:53,850 --> 00:07:57,960
So as you can see here it says this is animal one of 10.

109
00:07:57,960 --> 00:07:59,050
Right.

110
00:07:59,250 --> 00:08:05,980
And here as you can see we have this image view image I animal.

111
00:08:06,390 --> 00:08:11,880
So we use this valuable which is of type image view in order to hold the image that I want to show to

112
00:08:11,880 --> 00:08:12,420
the user.

113
00:08:12,420 --> 00:08:18,340
So for example here we have a mouse and the user by looking at this image can actually guess what it's

114
00:08:18,340 --> 00:08:19,710
going to be the name of this image.

115
00:08:19,710 --> 00:08:25,230
So now for example this mouse and now as you can see here it waits two seconds two or three seconds

116
00:08:25,560 --> 00:08:29,560
and the next question appears in line number 40.

117
00:08:29,610 --> 00:08:32,820
As you can see we have an array of linearly outs.

118
00:08:32,880 --> 00:08:33,490
Right.

119
00:08:33,510 --> 00:08:38,750
And then each of these array is rows of spottiness in animalcules.

120
00:08:38,760 --> 00:08:44,070
So where we're going to use this about right we have a variable which is actually an array of linearly

121
00:08:44,070 --> 00:08:49,310
outs and the name of this value but is the rows of guest buttons in animalcules.

122
00:08:49,500 --> 00:08:52,010
So for example as you can see we have two buttons here.

123
00:08:52,170 --> 00:08:53,860
We have another two buttons here.

124
00:08:53,880 --> 00:08:59,760
So as you can see we have two linearly outs that actually contain these buttons.

125
00:08:59,760 --> 00:09:06,150
The first linear layout is this one that actually contains two buttons forks and Tiger at the second

126
00:09:06,150 --> 00:09:07,320
linearly out here.

127
00:09:07,440 --> 00:09:10,530
This is actually horizontal linear left right.

128
00:09:10,710 --> 00:09:16,060
So this is our second linearly out that actually contains these two Bettina's peacock or chat.

129
00:09:16,080 --> 00:09:21,090
And if I click on the Settings button here and now if I click on this number of guesses here as you

130
00:09:21,090 --> 00:09:27,600
can see now if I select six and click on this back button here as you can see now we have six buttons.

131
00:09:27,590 --> 00:09:34,560
So this means that now we have three linearly outs so we use this array in order to actually control

132
00:09:35,100 --> 00:09:41,310
those are actually buttons those buttons so that they use that can actually change the number of buttons

133
00:09:41,310 --> 00:09:44,530
that can be appear on this quiz.

134
00:09:44,790 --> 00:09:49,370
So this is very important is that we create a variable for that of and array.

135
00:09:49,440 --> 00:09:56,280
As you can see here of the nearly outs in line number 41 we have another taste view and this is going

136
00:09:56,280 --> 00:09:57,570
to be the the answer.

137
00:09:57,570 --> 00:10:03,890
So for example at Fox and if I click click on these folks here now it says Fox exclamation mark you're

138
00:10:03,880 --> 00:10:04,400
right.

139
00:10:04,560 --> 00:10:09,360
So this variable is going to actually hold that value for us which is I think takes a few bites so we

140
00:10:09,360 --> 00:10:12,450
can actually create a reference to that text.

141
00:10:12,510 --> 00:10:16,870
And the lights are on actually logic here.

142
00:10:17,010 --> 00:10:23,030
So now I think you can actually understand what are these lines of code are doing here.

143
00:10:23,220 --> 00:10:29,450
So now we're going to go and put up more logic here inside this main activity fragment find.

