So now inside this palette section just click on images and select this image view and track this image
into our constrained to lay out and release it here.
So and is going to ask us to select one of these images.
Let's select this one.
I see Lanter around and then click on OK.
So let's open the web browser and here look at this Web site here picks that come here you can actually
find images for commercial use.
Let me actually change the settings a little bit.
All images changed it to virtual graphics and then click on search.
So now I want to hear just select one of these images.
I think this one is good.
So now first let me tell you that your Android may not be able to actually the operating system actually
may not be able to handle large images.
If you want to use a very large image inside your application your app may may be going to be a crash.
OK.
So make sure to choose a very small image so that the Android operating system would not be actually
have any problem in order to display this image to the user.
So which was the size here.
And then just click and download and I was going to download the image for us.
So let's open the Android studio and let's actually open the project paint at the top.
You can just click on View tool windows and then click on a project if you want to look at the project
pane here.
Now inside these folders just select this last for that open it and select this tribal folder.
Let me show you the image.
Here we have this image.
First let me tell you a very important point you cannot use an image that contains a dash.
This special character in its name lets select its image and let's actually rename this image we can
actually look the same as or right click on it and then click on Renay right.
Renay.
And then then it should be for example ice cream a very simple name.
This is good.
And copy it just right click on this image and click on copy and then he'll go to Android studio right
click on this driver for that and then paste.
So here it's going to show you the style like just click on OK.
It says copy is going I should copy that file for us to just click on the Cape and the image is copy
it into our Android studio here.
So now let's double click on this activity underline minute example let's select this image.
And here inside these properties view we have this as our C compact.
So let's actually click on this ellipsis button here this ellipsis button.
Now here selectees triable tab and click on icecream and then click on OK.
So we have this image here right.
So first let me actually decrease the size of this image so I just actually select this image and this
at the top left hand corner you can see this handler here that allows us to size this image right.
So let's actually make it a little bit smaller and just select this image and drag it here with the
top.
And here I think it's good.
Right.
So now I want to actually create some constraints here.
So here inside these properties window you can see all these attributes here.
And the first one is scale type.
I can't change this quilt for example 2 feet x y right.
Or I can change it to fit center or I can actually change it to center.
Right.
So let's actually choose feet center here.
I think it's with here now how to create constraints for this image.
First of all let me actually show you some of these options here.
The first one here at the top menu actually we have these options.
The first one is this height constraints.
So if you click on it it's going to actually hide the constraints for you.
So it's not recommended to do that because when you want to design the application you want to see the
constraints.
And the second icon is this one it says what.
Turn on auto connect.
So what is this.
This is actually going to create the constraints automatically for you.
You just have to for example put the components here and it's going to actually automatically create
the constraints for you.
OK.
So currently it is actually just turned off.
So if you want to turn it on you can actually click on it and in order to turn this on this feature
actually and now lets for example select this image and lets for example change it again.
Let's put it here and now we can see that the constraints is actually created for me automatically.
So this blueprint you can see that we have this lift constraint here and we have for example this top
constraint we have the size constraints so in this image that is propertys view here you can see these
size constraints inside these.
Actually this square right.
So if I click on these for example this size constraint here inside this square this is called the size
constraint and it's going to specify the size of their user interface components inside our constraints.
Let's click on it now.
It changed to what.
To actually match constraints.
Right.
It's going to take the entire constraint for us and it's going to actually fill up the constraint for
us.
You can see that the blueprint actually changed.
If I click on it again now it is in love content.
OK.
I like the lay out piece is wrapped content right.
If I click on it again.
Now it is actually fixed.
It is called a fixed constraint and the size is fixed.
And he had the layout with is this value and the layout height is this value it is fixed.
If I click on it again.
Now it is going to actually see it is going to actually match the constraints he had for us.
It's going to take the entire fleet without any margin.
If we want to I can specify some margins here.
So for example for the left margin I can't see 10.
And for the right amount I can say for example 10.
So now you can see that we have 10 value for the left margin and 10 value for the right margin here.
And we have also a top margin if we want to I can't for example enter the value zero for the top margin.
So for the top margin is assigned the value over I think 10 is good right.
So let's run our application and let's see what happens.
Just select one of these devices and then click on OK.
So here we can see that our ice cream image is actually here right.
Everything is set up automatically for us.
So here this is actually done for us.
This job is done for us by the Android studio by just turning on the water to kind of hear this feature
of Android studio.