Hire everyone in this theater you're going to go ahead and create another Android application.
So just click on this.
Start a new Android studio project here and then for the application name just type in here app 27 and
then click on next year's choose AP A16 Android 4.1 Jelly Bean for minimum STK click on next and here
choose blank activity next and then actually can finish.
OK.
First of all let's actually select these hello or takes you here and then press on it delete key on
your keyboard and then double click on this arrest folder here.
Lay out activity underline make that example OK.
And here choose fluting action button here and then press on delete key on your keyboard.
OK.
So now let's actually go back inside this content underline minute made that example and then double
click on this tab here in order to make this area wider.
So now it is actually track linearly out vertical into these relatively out here.
OK.
And put it at the center OK.
And then let's actually drag a scroll view of vertical scroll view into these linearly alphabetical
here.
So as you can see this is a vertical scroll view here and put it here at the center of this linear left
vertical OK.
And now this section is right and are there linearly out vertical into this scroll view here OK.
So as you know scroll you can only accept one direct child.
So if you just put in one scroll you hear and then you actually put a linearly aesthetical into this
scroll view.
And then when you can actually put all our components into this linearly aesthetical here.
OK so now let's actually track a large text view into this linearly and we're still here.
OK.
And double click on it for the text just type in here animal.
OK.
And then a person Enter key on your keyboard.
Now let's actually select this larger text view here and put it inside these linearly alphabetical here.
Double click on it and delete the text of this text view for the ID just step in here TXI the animal.
OK.
And then press on Enter key on your keyboard.
Now let's actually drag another large text view into this linearly afterwards to call here.
OK.
Double click on it and for the text just type in here lion and then press Enter key on your keyboard
and then let's actually drag and another large takes you into this linearly out of vertical here and
double click on it deletes the text of this text view for the ID just typing here takes the lion.
OK.
And then press Enter key on your keyboard so that it's actually and other large takes you into this
linearly elsewhere sequel here.
Double click on it and for the text just type in here.
Line using polymorphism.
OK.
And then Persaud Enter key on your keyboard.
OK.
And now let's actually track another large takes you into these linearly alphabetical double click on
it.
Is the text of the stakes for.
And for the idea just typing here takes the polymorphism
OK and then a person enter the key on your keyboard.
OK.
So now the design of art actually to use an interface is actually finished.
So now let's actually go back and say this main activity that you have a file here and then delete these
deleted is lines of code that are actually related to the Options menu here.
OK.
And then delete this block of code that is actually related to the floating action button.
Ok so now we don't actually put our own code here.
OK but first of all we need to actually create some classes some Java classes here inside that project.
OK so now let's actually create a class called animal.
So just click on file.
Ok new.
And then click on Java class here.
OK.
And for the name just type in here any month and then click on OK here.
Let's actually create another class for the new Jobar class for the name of the class just typing and
chat.
OK.
And it's actually create another class file new Java class here for the class name just type in here
lion and then click on.
OK.
So as you can see here we created our classes here and now this actually to go back and say this animal
that will find here and say that this animal class we can actually put in some lines of code here.
OK.
Let's actually declare some instance variables.
OK.
So as you can see here this is these are actually Lemar my instance variables that they actually declare
here.
So here I created I actually declared this instance variable.
The access modifier is private.
Actually the type of this instance valuable is strange.
And the name of this instance variable is animal name.
OK.
And here if you actually declared another instance variable private string animal culture private and
animal power and private it animals speak.
OK.
So not notice that I didn't actually instantiate this instance variables here.
So I'll just declare this in these instance variables OK.
Now let's actually create a constructor for this animal class here.
OK so I just can't.
I'm just going to pasting this constructor here and then I'm going to explain to you what's going on
here.
OK.
So as you can see here this is my constructor.
They actually paste that here.
OK.
The access modifier of this constructor is public.
The name of this constructor must be as this in name of these actually the class must be the same as
the name of this class name.
Ok here I actually specify that this constructor is going to accept some arguments.
Ok the first argument as you can see is actually of type strain.
And the name of this argument is the money.
OK.
And here as you can see our second argument is actually of type.
Strange animal culture in power in speed.
OK.
And here inside of these constructed here you can see that they actually created two statements here.
OK.
The first IF statement as you can see it says I should if the value of the power argument as you can
see I am referring to the name of this argument here OK if power is less than or equal to number 0.
OK then it's going I should be for an exception.
OK fro new illegal argument.
Exceptional case can actually prove an exception object.
OK here as you can see this new keyboard is going to create an exception object for a new legal argument
x exception.
So if you actually pass a value that is less than number zero to this constructor for this exception
and then it's going to show the text inside of the lock.
And we can see what's what's the error.
OK.
Actually that the application is going to crash.
If we actually put this line of code here.
OK but I just wanted to show you how you can use actual exceptions in your projects.
And here it says again if the value of this speed variable is less than or equal to number 0 again fro
new illegal argument exception the value of speed must be greater than number 0.
OK.
And then here I am actually instantiating these instance variables that I actually created inside this
animal class.
Does that animal name.
Here I am referring to this animal named instance valuable.
Does that animal name assignment operator animal.
Ok I am referring to this animal name argument here.
As you can see and here I am actually referring to the name of this animal color instance variable.
Does that animal color assignment operator animal color.
Here you can see I am referring to the name of this argument.
Does that animal power instance valuable here.
Assignment operator power argument.
OK.
And here I am actually typing I actually referred to the name of this instance variable does that animal
speed assignment operator speed.
OK so hopefully that makes sense.
Now there's actually some more lines of code here inside of this class.
So now let's actually create some getters and setters for these instance variables.
So here instead of this animal class as you can see here I can just right right click here.
OK.
And then click on generate as you can see here this is generate here.
You can actually hold the command key and then present an OK.
And then here as you can see here and actually create get here set here or I can actually create getters
and setters.
So I just just click on this get here and sit here and then hit as you can see these are our own instance
variables that we created inside of this class.
So just select all of these instance variables here.
OK.
And then click on OK.
So now as you can see the ID actually created these getters and setters automatically for us.
OK you can see this good animal name said animal name good animal Codder are set animal color gets animal
power to sit animal power with animals speed and animal speed here.
OK.