Pay everyone in this theater if you're going to go ahead and create another Android application.
So here I just need to click on this.
Start in your Android studio project and for the application name I just need to type in app of 46 and
then click on next year's choose API 16 Android 4.1 jellybean for the minimum SDK and then click on
next and here choose blank activity.
OK.
Next here are click on finish.
So here it lets actually select the hello world view here and then personally live here on your keyboard
and then go inside Israel's fault there lay out activity on the alignment of the exemption and then
select this floating action button and then press on delete key on your keyboard.
So let's actually go back and say this content underline minute example and here we want to actually
design the user interface of our application.
So now let me actually show you more of the application that we want to create in this tutorial.
So as you can see here this is the application that we want to create in this tutorial.
And as you can see here we have a text view here and the taste of this takes is these are the images
of our animals great view.
So we want to use our great view in this application and I want to show you how we can use that great
view in your applications.
And as you can see here at the bottom we have this great view and if you actually scroll down now I
can see the other images.
OK so now as you can see the images are actually are in are great in a great view.
OK.
So and if I actually click on one of these images for example this image it says the name of the animal
is bird.
The name of the animal is cats.
OK.
So we want to go ahead and use a great view in this application.
So let's actually go back and say this content underlined made that example.
And first of all we need to actually drag a linearly out vertical as you can see here into this relatively
healthy.
OK.
So just put it at the center of these relatively out.
And now actually drag our takes few large takes you into These are linearly out vertical.
So put it at the center of this linearly outwards call.
OK.
So as you can see here mistakenly I actually put it at the right place at the right of these linearly
at vertical OK.
So I can just drag it and put it at the center of these linearly linearly vertical.
So here I can just double click on it and for the takes just type in here these are the images these
are the images of our animals in a great view.
OK.
These are the images of our animals integrate view and then press Enter key on your keyboard.
OK.
So let's actually find that gravity the gravity attributes as you can see here.
This is our textfield and the Lyell's gravity attribute of this text is as you can see Center horizontal.
OK.
So these text view is actually at the center of this really vertical.
And now we have actually another attribute called gravity as you can see here.
So this is the this is the gravity attribute.
And if I open this gravity tribute by just clicking on this little triangle here here I need to actually
choose this center horizontal or checkbox and check the street box here and now as you can see this
text view is actually at the center of this text view here as you can see the text is at the center
of the state's view.
And now let's actually increase the size of this view.
So we have a text size here as you can see.
And for the text size assigned the value 6.
Now we can actually specify the color of that of our text view.
So I can just put in a hash tag.
0 0 0 0 F F and then press on and to key on your keyboard.
So as you can see now the color of our text is actually changed.
So now let's actually write up a great view.
So inside these are containers folder we have this great view here as you can see this is the great
view.
So just select it and put it inside this nearly vertical.
As you can see here.
So we have this great view here.
So just as you can see double click on it.
So if you have Nahm columns choice mode as you can see here and single choice multiple choice or multiple
choice model.
OK.
And we have ID.
OK.
So for the ID just type in here g r the view and then present Enter key on your keyboard.
So it's actually inside is a text tap here.
And now let's actually add some attributes for this great view here.
OK.
Now so now I'm going to paste in some lines of code here and then I'm going to explain to you what's
going on here.
OK.
So as you can see here these are the lines of code that I actually pasted here.
OK.
Android Cullom TDP.
So as you can see here inside our emulator here you have this great view here at the bottom OK.
And as you can see we have column Viets.
OK so this is the column of our great view 80.
OK and we have number of columns or two feet.
So the best option for this a number of columns and attributes is her feet.
OK so it can actually automatically fit the columns inside of our great view as you can see here.
And we have vertical spacing so 15 DP.
OK so as you can see here the vertical spacing is up for 15 DP.
OK.
And we have horizontal spacing as you can see here.
Again it is a 15 DP.
OK.
And then we have a column Veith as you can see here we have this threat.
And the value of this stretch more is column Viets.
OK.
So I think for the best option for this stretch more is called invasive and for the gravity the gravity
is at the center.
OK so our Actually our great view is at the center of these linearly elsewhere.
OK.
So hopefully that makes sense.
And now let's actually go back and say this main activity that of fight here and now are let's actually
delete these lines of code that are related to the of the menu options menu here.
And then let's actually delete this block of code that is still related to the floating action button.
So inside of this our main activity class let's actually declare an object of type.
Great view Okay great view.
And the name of this object is g r d view and then put a semicolon at the end of your statement.
And inside of this uncreate method let's actually initialize this great view object so I can just type
in great view or the view assignment operator.
And then here I need to actually cast this object to our great view object.
So I can just typing I can just put a pair of round Prentice's here I can I can't just type in great
view find view by I-T are thought Id dot G are the view.
OK.
And here I actually initialize this object by referring to this jihadi view object here inside of our
screen.
So here inside of this design we can see discrete view here.
OK.
Now let's actually create another class.
OK.
Another adapter that actually extends from the base adapter class.
OK.
So here are actually click on File New dhaba class and for the name of your class just type in here
a great view adapter.
OK.
And then click on OK.
So this is our great view class and this class and it's to actually extends from the base adapter class
if you want to actually use the grid view.
You need to actually extend from this base adapter class here.
So now if I actually opened up a browser here it is actually to debate it after class.
You can actually put in this you are in your web browser and in order to be guided to this page.
So this is the base it after class and this class is actually an abstract class.
OK.
And here as you can see it says common base class of common implementation for an adapter that can be
used in both list view.
OK.
By implementing this specialized it after interface and spinner.
OK.
So as you can see here we've got the if it's the public if it's the constructor here as you can see
and as you can see here we have these inherited constants.
OK.
And here you can see these Misfit's here.
OK so now let's actually go back to our Android studio ID.
And now as you can see it's showing us an error and it says that we need to actually implement this
specific methods because this class is actually extending from the space adapter class.
So we need to actually override the inherited methods that we actually inherit from the space adapter
class.
This is actually an abstract class.
Ok so here let's actually right click and then click on generate and here click on implement misfits.
So as you can see here these are the methods that we need to actually implement in our own class get
Count get item get item ID and get a view.
So just click on OK.
So here we can see that these benefits are actually up over rated here.
OK.
And then let's actually put in some lines of code here and then we've been actually putting our own
implementations inside of these methods.
So now let's actually direct some our images some animal images into our project.
So here in my on my desktop I have images here.
So I just need to select all of these images and then I need to copy these images.
Right click on them and then click on copy items and then here inside my ID I can actually click on
these tribal folder and then right click on it.
And here I can just click on paste.
So here I just need to click on this OK here.
So now as you can see these are the images of our animal animals as you can see here.