So now as you can see here our application is running on this emulator and now I want to click on these
settings button here this spitting image.
Now as you can see I actually transitioned to this activity settings activity right.
And now I can see these options these items so I can actually change the number of guesses.
So as you can see we have a typo here and I can actually it for example the animal is the type of anemones
that I want to include in say the keys.
I can actually change the background color or I can actually change the font of the texts of the buttons
that we have in say the quiz.
But for now we cannot actually change the settings because we haven't added that logic in order to actually
interact with these items.
Now as you can see at the top inside this action bar here we have dispatched button and now as you can
see we transitioned to this main activity.
And here you can see now we can actually play with the squeeze.
So now let's actually go inside the Android studio and now let's actually go inside its main activity
AFFREIGHTMENT here.
So just double click and is main activity fragment.
And now just double click on this tab here.
Main activity fragment that Jobab in order to make this area wider.
So here we are going to actually put some lines of code here inside this mine activity Fleischman class.
OK.
As you can see this main activity fragment is actually extending from this fragment.
Right.
So now I'm going to paste in some lines of code here inside this class and then I'm going to explain
to you what's going on here.
So as you can see here these are the lines of code that I pasted here.
So in line number 24 we have this a value bet actually.
So private static final INT.
So this is actually a constant and the name of this constant is animals included inquiries.
OK.
So we can actually change this name to number number of animals included inquiries.
So I decided to assign the value number 10 here you can assign any values that you want.
So this constant is going to determine that.
How many are animals that we've actually put inside our quiz.
So I decided to assign the value number 10 in line number 26.
We have a private list and this list actually accepts values of type stream.
Right.
And now as you can see here lists are actually like arrays we can assign arrays to this list.
Right.
But our list is actually on an interface in Java.
And this list interface has more functions or methods that we can actually use for our own good.
So that's why I actually use list instead of three or at least here and now you can see that we can
actually assign Ariz to this list and we can actually take advantage of the methods that we have inside
this list interface.
So we have a list of string values and the name of this list is all animals names list right and line
number 27 we have another list which is actually private which accepts values of types stream and the
name of this list is animals names quizz least as you can see here and here in line number 28.
We have another private set here.
We have set here this time.
So again our set is actually an interface that can not have duplicate its values.
So we cannot actually assign duplicated values to set or set is like a list.
OK.
We can actually assign an array of values to this set.
OK this is actually an interface right.
And as I said before because this is actually an interface we can actually use the methods that we have
inside this interface so we can assign an array to the set and we can take advantage of the methods
of this interface.
So this is a really good feature of java.
So again let me tell you that a set is actually like an array but you cannot design duplicated values
to a set.
So private set that accepts std.
String values and then Aimee's animal types inquiries.
And we have another string value thing valuable here.
As you can see private streams and the name is correct and commands answer right.
So this is going to be the message that we want to show to the user Whenever to use that actually our
is that the animal name right.
And in line number of 30 as you can see here we have a valuable and this is actually private integer
number of all guesses in line number 31.
We have another valuable integer number of right answers line number 42.
We have another variable integer number of animals.
Yes rows.
So we will be using these valuables here inside our code.
But here I just want to actually show you and I just I just want to introduce you.
It is really bells and later you will see that how we can actually use these valuables.
So a number of animals Jethro's in line number first free as you can see here.
We have actually a secure random number.
So here we have a valuable type secure random that can actually hold values of type secure and that
and the name of this variable is secure random number right in line number 44.
As you can see here we have another variable which is actually handler.
OK.
And the name of this variable is handler.
So literally you will see that are going to use this handler in order to actually transition between
the question.
So for example let me show you the emulator.
So as you can see here now our application is running on this emulator.
And here we can see that.
And I actually for example say beer and here it says bear.
And now it waits to want one or two seconds and then the next Actually question appears here.
The next image or the next question.
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
and then the next question appears.
So we use this handler in order to do that job for us.
So that's why they actually created this handler here a line number 45 as you can see here.
We have this animation.
So now we have a variable that actually holds the run and set animation.
So for example if we actually select Dolfin here now as you can see here this animation is occurring
here.
So we use this but in order to hold that animation and use it whenever I want in line number 37 as you
can see here we have this linearly out of body able of linearly out and the name of this valuable is
animalcules linearly out right.
So we use these are linearly out in order to actually for example change the background color of the
device.
For example if I click on the settings spot in here and if I select is truth by going uncolored for
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
baculum column of this linear level is red.
So I created this linearly out here in order to actually do that job.
We have a taste of.
The question number.
So as you can see here it says this is animal one of 10.
Right.
And here as you can see we have this image view image I animal.
So we use this valuable which is of type image view in order to hold the image that I want to show to
the user.
So for example here we have a mouse and the user by looking at this image can actually guess what it's
going to be the name of this image.
So now for example this mouse and now as you can see here it waits two seconds two or three seconds
and the next question appears in line number 40.
As you can see we have an array of linearly outs.
Right.
And then each of these array is rows of spottiness in animalcules.
So where we're going to use this about right we have a variable which is actually an array of linearly
outs and the name of this value but is the rows of guest buttons in animalcules.
So for example as you can see we have two buttons here.
We have another two buttons here.
So as you can see we have two linearly outs that actually contain these buttons.
The first linear layout is this one that actually contains two buttons forks and Tiger at the second
linearly out here.
This is actually horizontal linear left right.
So this is our second linearly out that actually contains these two Bettina's peacock or chat.
And if I click on the Settings button here and now if I click on this number of guesses here as you
can see now if I select six and click on this back button here as you can see now we have six buttons.
So this means that now we have three linearly outs so we use this array in order to actually control
those are actually buttons those buttons so that they use that can actually change the number of buttons
that can be appear on this quiz.
So this is very important is that we create a variable for that of and array.
As you can see here of the nearly outs in line number 41 we have another taste view and this is going
to be the the answer.
So for example at Fox and if I click click on these folks here now it says Fox exclamation mark you're
right.
So this variable is going to actually hold that value for us which is I think takes a few bites so we
can actually create a reference to that text.
And the lights are on actually logic here.
So now I think you can actually understand what are these lines of code are doing here.
So now we're going to go and put up more logic here inside this main activity fragment find.