1
00:00:00,500 --> 00:00:01,370
Hi everyone.

2
00:00:01,370 --> 00:00:04,980
So let's actually continue building this application.

3
00:00:05,000 --> 00:00:10,760
First of all let's actually design the user interface Let's go to the activity under limited exam and

4
00:00:10,760 --> 00:00:14,250
here now are here in this application.

5
00:00:14,290 --> 00:00:20,040
We are not going to actually get to use the user's location anymore so let's delete these takes few

6
00:00:20,090 --> 00:00:20,990
here.

7
00:00:21,440 --> 00:00:23,960
And let's also go to the main activity class.

8
00:00:24,320 --> 00:00:30,770
And here let's actually delete this or let's comment out or you can actually comment all or you can

9
00:00:30,980 --> 00:00:32,680
delete this text view.

10
00:00:32,720 --> 00:00:37,610
So let me actually find this one here you can see this valuable declaration takes the location.

11
00:00:37,610 --> 00:00:39,020
So let me delete it.

12
00:00:39,020 --> 00:00:43,790
Now let me also delete this line of code that actually initialize this variable.

13
00:00:43,790 --> 00:00:49,180
Now let's actually find that is to show the use of location method.

14
00:00:49,180 --> 00:00:51,360
Here we can see this method.

15
00:00:51,470 --> 00:00:57,610
So let's also comment out this method because we are not going to use this method anymore.

16
00:00:58,260 --> 00:00:58,830
OK.

17
00:00:59,300 --> 00:01:05,790
So let me actually find the error here because inside our file we have error so we can see that inside

18
00:01:05,800 --> 00:01:07,550
is unconnected Mefford.

19
00:01:07,670 --> 00:01:09,250
I am actually calling this method.

20
00:01:09,250 --> 00:01:10,340
Sure they use allocation.

21
00:01:10,340 --> 00:01:16,680
So let's also come out of the Smurfette And now as you can see we have no errors here in this file.

22
00:01:16,970 --> 00:01:19,860
And here you can see that line number 21.

23
00:01:19,860 --> 00:01:21,790
We have this value of that location.

24
00:01:21,800 --> 00:01:23,720
So we don't need this value but any more.

25
00:01:23,750 --> 00:01:27,020
So let me just comment out this line of code here.

26
00:01:27,020 --> 00:01:28,940
So now everything is fine.

27
00:01:29,000 --> 00:01:36,110
So let's run the application and let's see if everything works well and if our application of our application

28
00:01:36,110 --> 00:01:41,960
crashes or not let's click on OK so you can see that our application is running on the simulator and

29
00:01:41,990 --> 00:01:43,170
everything is fine.

30
00:01:43,340 --> 00:01:45,080
So let's go back to android studio.

31
00:01:45,160 --> 00:01:48,290
Let's go to the activity underlaid minute example first.

32
00:01:48,590 --> 00:01:54,590
Let's actually track and edit into are actually constrained to lay out here.

33
00:01:54,590 --> 00:02:01,250
So let me actually just find it it takes so hit inside this palette section just click context and select

34
00:02:01,490 --> 00:02:08,220
this plaintext and just track it here into these constraints and put its center horizontal here.

35
00:02:08,300 --> 00:02:08,710
Right.

36
00:02:08,780 --> 00:02:12,200
You can see that I am actually using these guidelines to position.

37
00:02:12,210 --> 00:02:16,790
This actually does it it takes so just positioned it here.

38
00:02:17,240 --> 00:02:22,060
Now you can see that the constraints are actually created for me automatically.

39
00:02:22,430 --> 00:02:26,370
So now let's just select this as a text.

40
00:02:26,540 --> 00:02:31,890
And here you can see inside these properties we have these constraints here the size constraints.

41
00:02:31,910 --> 00:02:36,160
So let's actually click on this size constraint for the Wii.

42
00:02:36,260 --> 00:02:40,370
So just click on it and change it to actually match constraints.

43
00:02:40,370 --> 00:02:45,580
So in this way it can actually take the entire wheat here the total weight of these constraints lay

44
00:02:45,570 --> 00:02:46,870
out.

45
00:02:47,060 --> 00:02:49,050
Now let's select this it works.

46
00:02:49,070 --> 00:02:57,970
And for the ID just type in here it is the address EDT address and then press Enter key on your keyboard.

47
00:02:58,350 --> 00:03:03,860
Now let's actually provide a hint value for this as it takes.

48
00:03:03,850 --> 00:03:08,750
So just select is editor X and for the hint attribute here just typing here.

49
00:03:08,760 --> 00:03:14,800
Enter the address dot dot dot and then person enter on your keyboard.

50
00:03:15,040 --> 00:03:20,950
So now you can see this text attribute so let's delete this name value that we have inside this text

51
00:03:20,950 --> 00:03:24,430
field and you can see now this hint attribute here.

52
00:03:24,430 --> 00:03:26,210
Enter the address here.

53
00:03:26,470 --> 00:03:30,740
So let's drag our text view into our constraint layout.

54
00:03:30,880 --> 00:03:37,000
So again inside this palette section you click on widgets and click on text view and just drag it here

55
00:03:37,000 --> 00:03:42,470
into our constraints laid out and put it below it is added text here.

56
00:03:42,730 --> 00:03:47,260
So let's actually create some constraints for this text view as against it.

57
00:03:47,260 --> 00:03:49,390
You can see it is a pop constraint here.

58
00:03:49,570 --> 00:03:54,140
So just click on the top edge here and you can see this little circle.

59
00:03:54,220 --> 00:03:56,290
So that is actually pulsating right.

60
00:03:56,320 --> 00:04:04,570
So just actually drag this line to the bottom edge of this eddy text you can see this one here to this

61
00:04:04,570 --> 00:04:10,100
little circle that is actually on the bottom edge of this eddy text and just release it.

62
00:04:10,330 --> 00:04:17,020
So now our constraint is actually created here so you can see inside these properties that the margin

63
00:04:17,020 --> 00:04:19,370
top of this text is a.

64
00:04:19,390 --> 00:04:25,370
So let's change this eight to for example 30 and then personated on your keyboard.

65
00:04:25,370 --> 00:04:25,750
So now.

66
00:04:25,810 --> 00:04:28,260
So now the text is here right.

67
00:04:28,660 --> 00:04:34,870
So now you can see that the left right and the height of this text view is rock content and that's because

68
00:04:34,870 --> 00:04:36,070
of the size constraint.

69
00:04:36,070 --> 00:04:43,040
If we actually hover over this bit size constraint here is going to say Lappe content right.

70
00:04:43,060 --> 00:04:48,820
Or if we actually hover over this height size constraint it says content.

71
00:04:48,880 --> 00:04:52,460
So let's select this text view and for the ID.

72
00:04:52,480 --> 00:04:55,060
Here let's just type in here.

73
00:04:55,210 --> 00:05:00,000
The distance is the distance value right.

74
00:05:00,010 --> 00:05:02,130
And that person enter key on your keyboard.

75
00:05:02,140 --> 00:05:07,260
So this is the ID and for the text atrip of this text you just type in.

76
00:05:07,250 --> 00:05:15,380
Here are de-value of the distance goes here.

77
00:05:15,510 --> 00:05:15,970
Right.

78
00:05:16,110 --> 00:05:22,200
So this takes you actually holds the distance between the current location the current location of the

79
00:05:22,200 --> 00:05:24,720
user and the destination location.

80
00:05:24,900 --> 00:05:30,200
So the destination location is going to be specified by the address that the user actually enters inside

81
00:05:30,210 --> 00:05:32,050
this eddy text.

82
00:05:32,130 --> 00:05:39,040
So let's drag and another takes you into are actually into our layout getting into this kind of strange

83
00:05:39,060 --> 00:05:39,550
layout.

84
00:05:39,750 --> 00:05:42,780
So let's strike these takes you and put it here below.

85
00:05:42,810 --> 00:05:45,450
This takes you here.

86
00:05:45,480 --> 00:05:47,940
So as you can see by default it is here right.

87
00:05:47,940 --> 00:05:49,950
I just need to track it and put it here below.

88
00:05:50,060 --> 00:05:58,620
This takes view now that actually you can see that the lift constraint here and the right constraint

89
00:05:58,620 --> 00:05:59,860
is actually created here.

90
00:05:59,880 --> 00:06:06,480
The left edge of this text view is actually attached to the left edge of this layout.

91
00:06:06,480 --> 00:06:11,420
And right as of this this is attached to the right edge of this layout.

92
00:06:11,490 --> 00:06:17,220
And now you may ask that so why it is not attached you see attached but it is not attached.

93
00:06:17,250 --> 00:06:21,750
There is actually a distance that is a space between these text view and the left edge and there is

94
00:06:21,750 --> 00:06:26,780
a space between the right of the text view and the right as these are actually left.

95
00:06:26,790 --> 00:06:32,850
And the reason is that this takes view that they left feet and the layout height of this this view is

96
00:06:32,850 --> 00:06:34,240
actually that content.

97
00:06:34,260 --> 00:06:35,220
Right.

98
00:06:35,220 --> 00:06:40,500
And you can see that the left margin and the right margin is zero but you can see because this is actually

99
00:06:40,500 --> 00:06:41,280
a wrapped content.

100
00:06:41,280 --> 00:06:46,530
It is not completely attached to the right or the left edge of this play out.

101
00:06:46,830 --> 00:06:53,450
So let's actually create another constraint for this takes fuel so we can see it is a top edge here.

102
00:06:53,490 --> 00:06:57,200
This little circle on the top edge of this text view that is actually pulsating.

103
00:06:57,420 --> 00:07:05,160
So just create a constraint to the bottom edge to this little circle of the on the bottom edge of this

104
00:07:05,310 --> 00:07:06,670
takes you here.

105
00:07:06,720 --> 00:07:11,760
This distance here and just creates this constraint here.

106
00:07:11,790 --> 00:07:16,020
Now we can see that it says that the top margin of this takes is eight.

107
00:07:16,170 --> 00:07:19,840
So let's change it to 30 and then person until keyboard.

108
00:07:20,100 --> 00:07:21,830
Now let's selectees this view.

109
00:07:21,870 --> 00:07:26,350
So here let's actually provide an ID for this takes.

110
00:07:26,370 --> 00:07:33,080
So for the ID to step in here takes the actually time and then present and tell you on your keyboard

111
00:07:33,450 --> 00:07:38,550
so you can see that the layout which is content the layout height is set up content.

112
00:07:38,550 --> 00:07:49,770
Now that's actually for the text to say in here time actually remained time remained to get to the location

113
00:07:50,010 --> 00:07:58,160
to the destination location actually destination location and then person and tell on your keyboard.

114
00:07:58,290 --> 00:08:04,700
And I would like you to provide two more texts for their users so that the user can actually enter them

115
00:08:04,750 --> 00:08:06,130
mile per hour.

116
00:08:06,210 --> 00:08:06,570
OK.

117
00:08:06,580 --> 00:08:11,990
The mile per hour that they use that can actually travel to the destination location and to actually

118
00:08:12,300 --> 00:08:17,160
distance or the meters that they use that actually travel in each mile.

119
00:08:17,190 --> 00:08:17,430
OK.

120
00:08:17,430 --> 00:08:18,840
In each mile per hour.

121
00:08:18,840 --> 00:08:20,600
So let's provide those two takes.

122
00:08:20,610 --> 00:08:23,190
Use those to Ed. It's actually here.

123
00:08:23,460 --> 00:08:26,830
So now let's actually select these two.

124
00:08:26,990 --> 00:08:34,230
It takes two views here by just you can see that they actually created this triangle in order to select

125
00:08:34,620 --> 00:08:39,750
both of these takes views or if you want to you can actually select them inside this componentry section.

126
00:08:39,750 --> 00:08:43,900
Just hold down the comment on your keyboard and then select both of these text views.

127
00:08:44,160 --> 00:08:49,470
And if you are using a Windows machine you just need to hold down the control on your keyboard and then

128
00:08:49,470 --> 00:08:54,140
just select these two takes views and strike them here a little bit to the bottom.

129
00:08:57,120 --> 00:08:57,800
Right.

130
00:08:57,870 --> 00:09:03,330
So you can see that when I actually tracked them to the bottom the constraint are actually the same.

131
00:09:03,330 --> 00:09:08,880
The constraints are the same but you can see that the margin top is actually increased the margin top

132
00:09:09,210 --> 00:09:11,360
of these text view is increased.

133
00:09:11,430 --> 00:09:13,800
And you can see that it is 34.

134
00:09:13,860 --> 00:09:21,210
So now we need to actually delete one of these constraints here so let's select this TXI the distance

135
00:09:21,210 --> 00:09:24,720
value here and you can see these pop constraints right.

136
00:09:24,720 --> 00:09:29,450
If I double click on it now you can see that this top constraint here is actually deleted.

137
00:09:29,910 --> 00:09:34,620
So let's try and edit Hick's into this constraint way out.

138
00:09:34,650 --> 00:09:40,110
So here inside this palette section just click on text and drag this plain text and put it here below

139
00:09:40,110 --> 00:09:42,270
this enter the address here.

140
00:09:44,000 --> 00:09:51,850
So I need to select this edit text and put it here below this as it takes and it's actually a selective

141
00:09:51,890 --> 00:09:58,490
editing and it's pro-white a constraint for this edit text so we can see this little circle on the top

142
00:09:58,570 --> 00:10:00,470
edge of this edit text right.

143
00:10:00,470 --> 00:10:07,070
So just create a constraint to the bottom to the bottom edge of this text here so let me actually just

144
00:10:07,070 --> 00:10:09,020
to make it here a little bit here.

145
00:10:09,080 --> 00:10:11,480
So now you can see that they actually created this constraint.

146
00:10:11,480 --> 00:10:12,510
So let me delete it.

147
00:10:12,770 --> 00:10:17,570
And so that they can actually see what I'm doing here you can see that I am actually creating this constraint

148
00:10:17,780 --> 00:10:20,640
to the bottom of it it takes you enter the address.

149
00:10:20,660 --> 00:10:22,850
So let's actually create that constraint here.

150
00:10:23,210 --> 00:10:29,820
Now let's change the size constraint for the Veith of this it it takes here inside this property section.

151
00:10:29,840 --> 00:10:31,910
You can see this Viets size constraints.

152
00:10:31,910 --> 00:10:37,790
Just click on it and change it back to actually a match constraint so that it is going to take the entire

153
00:10:37,790 --> 00:10:40,580
width of this constraint out.

154
00:10:40,580 --> 00:10:44,890
Now let's provide a hint actually for this text.

155
00:10:44,900 --> 00:10:47,630
So for the hint attribute just typing here.

156
00:10:47,750 --> 00:10:54,000
Enter my miles per hour per hour.

157
00:10:55,450 --> 00:10:57,580
And then press enter on your keyboard.

158
00:10:57,610 --> 00:11:03,550
So for that name attribute here you can see for the text attributes we have this name text which still

159
00:11:03,540 --> 00:11:06,550
is this name and then person and tell him your key word.

160
00:11:06,550 --> 00:11:10,180
Now let's actually track and order edit text into our layout.

161
00:11:10,180 --> 00:11:17,350
So again inside this palette section can text and just track the plain text into this layout and put

162
00:11:17,350 --> 00:11:18,790
it here.

163
00:11:18,820 --> 00:11:24,670
So by default it is going to be actually put here on the top left hand corner of the layout.

164
00:11:24,700 --> 00:11:31,540
So we just need to just drag it just select it and drag it here do this until the mph edit takes and

165
00:11:32,470 --> 00:11:40,480
let's create actually a constraint from the top edge of this text to the bottom of this Enter miles

166
00:11:40,720 --> 00:11:44,200
per hour as it takes which is actually create this constraint here.

167
00:11:44,620 --> 00:11:50,830
So now let's change the size constraint of this that it takes to actually match constraints.

168
00:11:50,820 --> 00:11:52,540
So let's select this as it takes.

169
00:11:52,540 --> 00:11:59,710
And here for this size constraint of the feet just click on it and change it to actually match constraint.

170
00:11:59,770 --> 00:12:06,670
Right now let's select it it takes and 30 miles per hour and let's provide an ID for this Id take so

171
00:12:06,690 --> 00:12:10,980
just like it ADT miles per hour.

172
00:12:12,990 --> 00:12:17,690
And unprecedented on your keyboard so you can see it says update usages as well.

173
00:12:17,800 --> 00:12:18,530
And then just click on.

174
00:12:18,540 --> 00:12:19,700
Yes.

175
00:12:19,800 --> 00:12:25,390
So let's click on this editrix and for the ID just type in here it it easy meters.

176
00:12:26,320 --> 00:12:29,060
EDT meter's pyramid.

177
00:12:29,140 --> 00:12:35,250
So they use that I can actually specify these values and let's selectees it again.

178
00:12:35,290 --> 00:12:42,840
And for the text that attributes Let's actually delete this name text and let's provide a hint for this

179
00:12:42,850 --> 00:12:44,960
and it takes just step in here.

180
00:12:45,550 --> 00:12:55,660
Does that mean enter meters Edomite and then dot dot dot and that person until you're both.

181
00:12:55,790 --> 00:12:57,110
So let's select this as it takes.

182
00:12:57,110 --> 00:12:58,340
Enter miles per hour.

183
00:12:58,610 --> 00:13:03,290
And for the painters tribute just put dot dot dot at the end.

184
00:13:04,120 --> 00:13:05,470
So that's it.

185
00:13:05,470 --> 00:13:10,230
Now let's actually create a constraint for this text here for this text.

186
00:13:10,380 --> 00:13:11,600
Excuse me for this.

187
00:13:11,600 --> 00:13:12,310
I text you.

188
00:13:12,360 --> 00:13:15,340
That is that says the value of the distance goes here.

189
00:13:15,420 --> 00:13:19,600
So you can see it is at the top edge of this text.

190
00:13:19,610 --> 00:13:23,140
You have this little circle that is actually pulsating right.

191
00:13:23,160 --> 00:13:31,520
So let's create a constraint to the bottom edge of this editrix enter mph and just release it.

192
00:13:31,530 --> 00:13:36,060
So let's actually change the top margin of this text view.

193
00:13:36,060 --> 00:13:37,860
Let's change it to 50.

194
00:13:39,010 --> 00:13:40,120
So that's it.

195
00:13:40,150 --> 00:13:42,620
And now we can see that everything is fine.

196
00:13:43,000 --> 00:13:46,670
Let's actually drag about him into our constraints lay out.

197
00:13:46,750 --> 00:13:53,220
So he said these pellets section just click on widgets and select a spot in and just track it here below

198
00:13:53,230 --> 00:13:55,340
this text view.

199
00:13:55,450 --> 00:14:01,750
Now I want to actually change the spot and I want to change the size constraint for the Veach of the

200
00:14:01,750 --> 00:14:04,880
spot and to match constraint to select the spot.

201
00:14:05,170 --> 00:14:07,110
And here inside this property section.

202
00:14:07,330 --> 00:14:14,860
Just click on this actually size constraint of the Viets and change it to actually match constraints.

203
00:14:14,860 --> 00:14:19,970
And on the top edge on the top edge of the spot and you can see this little circle that is pulsating.

204
00:14:20,110 --> 00:14:23,670
Create a constraint to the bottom edge of this text view.

205
00:14:23,770 --> 00:14:29,710
Ok to this little circle that is underbody it of this takes view and just release it.

206
00:14:29,710 --> 00:14:35,350
So let's actually change the top margin of the spot in here inside this property section to actually

207
00:14:35,360 --> 00:14:38,790
25 and then press enter key on your keyboard.

208
00:14:38,800 --> 00:14:46,330
So let's actually change it to a 55 to top the top margin to actually change it to 55.

209
00:14:46,370 --> 00:14:47,950
So it's good.

210
00:14:47,950 --> 00:14:53,490
Now it's time to run the application and let's see if everything is working fine or not.

211
00:14:53,530 --> 00:15:00,220
Let's click on actually run so you can see that our application is running on this simulator and we

212
00:15:00,220 --> 00:15:02,080
have these edit texts.

213
00:15:02,080 --> 00:15:04,880
We have this text view this one and this button.

214
00:15:05,050 --> 00:15:06,810
So let's go back to our Android studio.

215
00:15:06,820 --> 00:15:11,130
Let's select the spot and let's provide an ID for this spot and so just typing here.

216
00:15:11,140 --> 00:15:16,560
PTEN get that data with that data.

217
00:15:17,870 --> 00:15:19,790
And then it's an intelligent keyboard.

218
00:15:20,030 --> 00:15:28,910
And for the text attribute of this actually button to save in here gets the data and then person enter

219
00:15:28,980 --> 00:15:30,980
Kiran on your keyboard.

220
00:15:31,130 --> 00:15:31,940
So that's it.

221
00:15:32,120 --> 00:15:37,130
So let's actually go to actually main activity class.

222
00:15:37,130 --> 00:15:42,320
So he had to actually create another class inside our project so we're going to do that in the next

223
00:15:42,320 --> 00:15:43,030
tutorial.

224
00:15:43,190 --> 00:15:44,380
Thank you very much for watching.

225
00:15:44,390 --> 00:15:49,730
And if you have any questions about the concepts that I had to this lesson actually please post the

226
00:15:49,730 --> 00:15:53,260
discussion in the course and then I do my best to answer all of your questions.

