Hi everyone.
So let's actually continue building this application.
First of all let's actually design the user interface Let's go to the activity under limited exam and
here now are here in this application.
We are not going to actually get to use the user's location anymore so let's delete these takes few
here.
And let's also go to the main activity class.
And here let's actually delete this or let's comment out or you can actually comment all or you can
delete this text view.
So let me actually find this one here you can see this valuable declaration takes the location.
So let me delete it.
Now let me also delete this line of code that actually initialize this variable.
Now let's actually find that is to show the use of location method.
Here we can see this method.
So let's also comment out this method because we are not going to use this method anymore.
OK.
So let me actually find the error here because inside our file we have error so we can see that inside
is unconnected Mefford.
I am actually calling this method.
Sure they use allocation.
So let's also come out of the Smurfette And now as you can see we have no errors here in this file.
And here you can see that line number 21.
We have this value of that location.
So we don't need this value but any more.
So let me just comment out this line of code here.
So now everything is fine.
So let's run the application and let's see if everything works well and if our application of our application
crashes or not let's click on OK so you can see that our application is running on the simulator and
everything is fine.
So let's go back to android studio.
Let's go to the activity underlaid minute example first.
Let's actually track and edit into are actually constrained to lay out here.
So let me actually just find it it takes so hit inside this palette section just click context and select
this plaintext and just track it here into these constraints and put its center horizontal here.
Right.
You can see that I am actually using these guidelines to position.
This actually does it it takes so just positioned it here.
Now you can see that the constraints are actually created for me automatically.
So now let's just select this as a text.
And here you can see inside these properties we have these constraints here the size constraints.
So let's actually click on this size constraint for the Wii.
So just click on it and change it to actually match constraints.
So in this way it can actually take the entire wheat here the total weight of these constraints lay
out.
Now let's select this it works.
And for the ID just type in here it is the address EDT address and then press Enter key on your keyboard.
Now let's actually provide a hint value for this as it takes.
So just select is editor X and for the hint attribute here just typing here.
Enter the address dot dot dot and then person enter on your keyboard.
So now you can see this text attribute so let's delete this name value that we have inside this text
field and you can see now this hint attribute here.
Enter the address here.
So let's drag our text view into our constraint layout.
So again inside this palette section you click on widgets and click on text view and just drag it here
into our constraints laid out and put it below it is added text here.
So let's actually create some constraints for this text view as against it.
You can see it is a pop constraint here.
So just click on the top edge here and you can see this little circle.
So that is actually pulsating right.
So just actually drag this line to the bottom edge of this eddy text you can see this one here to this
little circle that is actually on the bottom edge of this eddy text and just release it.
So now our constraint is actually created here so you can see inside these properties that the margin
top of this text is a.
So let's change this eight to for example 30 and then personated on your keyboard.
So now.
So now the text is here right.
So now you can see that the left right and the height of this text view is rock content and that's because
of the size constraint.
If we actually hover over this bit size constraint here is going to say Lappe content right.
Or if we actually hover over this height size constraint it says content.
So let's select this text view and for the ID.
Here let's just type in here.
The distance is the distance value right.
And that person enter key on your keyboard.
So this is the ID and for the text atrip of this text you just type in.
Here are de-value of the distance goes here.
Right.
So this takes you actually holds the distance between the current location the current location of the
user and the destination location.
So the destination location is going to be specified by the address that the user actually enters inside
this eddy text.
So let's drag and another takes you into are actually into our layout getting into this kind of strange
layout.
So let's strike these takes you and put it here below.
This takes you here.
So as you can see by default it is here right.
I just need to track it and put it here below.
This takes view now that actually you can see that the lift constraint here and the right constraint
is actually created here.
The left edge of this text view is actually attached to the left edge of this layout.
And right as of this this is attached to the right edge of this layout.
And now you may ask that so why it is not attached you see attached but it is not attached.
There is actually a distance that is a space between these text view and the left edge and there is
a space between the right of the text view and the right as these are actually left.
And the reason is that this takes view that they left feet and the layout height of this this view is
actually that content.
Right.
And you can see that the left margin and the right margin is zero but you can see because this is actually
a wrapped content.
It is not completely attached to the right or the left edge of this play out.
So let's actually create another constraint for this takes fuel so we can see it is a top edge here.
This little circle on the top edge of this text view that is actually pulsating.
So just create a constraint to the bottom edge to this little circle of the on the bottom edge of this
takes you here.
This distance here and just creates this constraint here.
Now we can see that it says that the top margin of this takes is eight.
So let's change it to 30 and then person until keyboard.
Now let's selectees this view.
So here let's actually provide an ID for this takes.
So for the ID to step in here takes the actually time and then present and tell you on your keyboard
so you can see that the layout which is content the layout height is set up content.
Now that's actually for the text to say in here time actually remained time remained to get to the location
to the destination location actually destination location and then person and tell on your keyboard.
And I would like you to provide two more texts for their users so that the user can actually enter them
mile per hour.
OK.
The mile per hour that they use that can actually travel to the destination location and to actually
distance or the meters that they use that actually travel in each mile.
OK.
In each mile per hour.
So let's provide those two takes.
Use those to Ed. It's actually here.
So now let's actually select these two.
It takes two views here by just you can see that they actually created this triangle in order to select
both of these takes views or if you want to you can actually select them inside this componentry section.
Just hold down the comment on your keyboard and then select both of these text views.
And if you are using a Windows machine you just need to hold down the control on your keyboard and then
just select these two takes views and strike them here a little bit to the bottom.
Right.
So you can see that when I actually tracked them to the bottom the constraint are actually the same.
The constraints are the same but you can see that the margin top is actually increased the margin top
of these text view is increased.
And you can see that it is 34.
So now we need to actually delete one of these constraints here so let's select this TXI the distance
value here and you can see these pop constraints right.
If I double click on it now you can see that this top constraint here is actually deleted.
So let's try and edit Hick's into this constraint way out.
So here inside this palette section just click on text and drag this plain text and put it here below
this enter the address here.
So I need to select this edit text and put it here below this as it takes and it's actually a selective
editing and it's pro-white a constraint for this edit text so we can see this little circle on the top
edge of this edit text right.
So just create a constraint to the bottom to the bottom edge of this text here so let me actually just
to make it here a little bit here.
So now you can see that they actually created this constraint.
So let me delete it.
And so that they can actually see what I'm doing here you can see that I am actually creating this constraint
to the bottom of it it takes you enter the address.
So let's actually create that constraint here.
Now let's change the size constraint for the Veith of this it it takes here inside this property section.
You can see this Viets size constraints.
Just click on it and change it back to actually a match constraint so that it is going to take the entire
width of this constraint out.
Now let's provide a hint actually for this text.
So for the hint attribute just typing here.
Enter my miles per hour per hour.
And then press enter on your keyboard.
So for that name attribute here you can see for the text attributes we have this name text which still
is this name and then person and tell him your key word.
Now let's actually track and order edit text into our layout.
So again inside this palette section can text and just track the plain text into this layout and put
it here.
So by default it is going to be actually put here on the top left hand corner of the layout.
So we just need to just drag it just select it and drag it here do this until the mph edit takes and
let's create actually a constraint from the top edge of this text to the bottom of this Enter miles
per hour as it takes which is actually create this constraint here.
So now let's change the size constraint of this that it takes to actually match constraints.
So let's select this as it takes.
And here for this size constraint of the feet just click on it and change it to actually match constraint.
Right now let's select it it takes and 30 miles per hour and let's provide an ID for this Id take so
just like it ADT miles per hour.
And unprecedented on your keyboard so you can see it says update usages as well.
And then just click on.
Yes.
So let's click on this editrix and for the ID just type in here it it easy meters.
EDT meter's pyramid.
So they use that I can actually specify these values and let's selectees it again.
And for the text that attributes Let's actually delete this name text and let's provide a hint for this
and it takes just step in here.
Does that mean enter meters Edomite and then dot dot dot and that person until you're both.
So let's select this as it takes.
Enter miles per hour.
And for the painters tribute just put dot dot dot at the end.
So that's it.
Now let's actually create a constraint for this text here for this text.
Excuse me for this.
I text you.
That is that says the value of the distance goes here.
So you can see it is at the top edge of this text.
You have this little circle that is actually pulsating right.
So let's create a constraint to the bottom edge of this editrix enter mph and just release it.
So let's actually change the top margin of this text view.
Let's change it to 50.
So that's it.
And now we can see that everything is fine.
Let's actually drag about him into our constraints lay out.
So he said these pellets section just click on widgets and select a spot in and just track it here below
this text view.
Now I want to actually change the spot and I want to change the size constraint for the Veach of the
spot and to match constraint to select the spot.
And here inside this property section.
Just click on this actually size constraint of the Viets and change it to actually match constraints.
And on the top edge on the top edge of the spot and you can see this little circle that is pulsating.
Create a constraint to the bottom edge of this text view.
Ok to this little circle that is underbody it of this takes view and just release it.
So let's actually change the top margin of the spot in here inside this property section to actually
25 and then press enter key on your keyboard.
So let's actually change it to a 55 to top the top margin to actually change it to 55.
So it's good.
Now it's time to run the application and let's see if everything is working fine or not.
Let's click on actually run so you can see that our application is running on this simulator and we
have these edit texts.
We have this text view this one and this button.
So let's go back to our Android studio.
Let's select the spot and let's provide an ID for this spot and so just typing here.
PTEN get that data with that data.
And then it's an intelligent keyboard.
And for the text attribute of this actually button to save in here gets the data and then person enter
Kiran on your keyboard.
So that's it.
So let's actually go to actually main activity class.
So he had to actually create another class inside our project so we're going to do that in the next
tutorial.
Thank you very much for watching.
And if you have any questions about the concepts that I had to this lesson actually please post the
discussion in the course and then I do my best to answer all of your questions.