1
00:00:00,180 --> 00:00:05,600
Hire everyone in this theater you are always going to go ahead and create another Android application.

2
00:00:05,610 --> 00:00:06,540
So just click on this.

3
00:00:06,540 --> 00:00:14,340
Start in your Android studio project and for the application name just type in your app 46 and here

4
00:00:14,550 --> 00:00:24,140
for the minimum SDK choose API 16 Android 4.1 Jelly Bean and then click on next and here choose MT activity.

5
00:00:24,320 --> 00:00:24,770
OK.

6
00:00:24,840 --> 00:00:25,680
Next.

7
00:00:26,010 --> 00:00:28,170
And then here click on finish.

8
00:00:28,710 --> 00:00:31,970
So now as you can see our application is created.

9
00:00:32,160 --> 00:00:34,730
Let's actually double click on this folder here.

10
00:00:34,860 --> 00:00:40,060
Double click on this layout folder and then double click on this activity underline that example.

11
00:00:40,350 --> 00:00:46,940
So here as you can see this is our activity underline made that example and here we have some errors.

12
00:00:46,980 --> 00:00:54,120
So in order to fix the error there is a bug in Android studio and my actually my project couldn't identify

13
00:00:54,120 --> 00:00:55,690
the proper Feme.

14
00:00:55,800 --> 00:01:02,160
So in order to solve that error you need to actually click on this field here at the top and then here

15
00:01:02,160 --> 00:01:06,370
you can actually click on material that light or material dark.

16
00:01:06,510 --> 00:01:14,160
So I prefer this material light and here choose material that light that dot dot action.

17
00:01:14,170 --> 00:01:16,820
But OK I prefer I prefer this film.

18
00:01:16,950 --> 00:01:20,930
You can actually choose other films but I think this film is better.

19
00:01:20,970 --> 00:01:22,280
And then click on OK.

20
00:01:22,560 --> 00:01:27,570
So now here is our application and we have actually a dart action bar here.

21
00:01:27,600 --> 00:01:30,510
So now it's actually the selectees hello world takes you.

22
00:01:30,530 --> 00:01:33,350
And then press on delete key on your keyboard.

23
00:01:33,660 --> 00:01:38,560
And here now I want to actually use tab host in my application.

24
00:01:38,590 --> 00:01:43,550
So inside the containers folder we have this tab host here.

25
00:01:43,560 --> 00:01:44,140
OK.

26
00:01:44,220 --> 00:01:47,410
So just select it and then put it inside.

27
00:01:47,410 --> 00:01:50,120
These are truly inside these relatively out.

28
00:01:50,130 --> 00:01:52,860
So just put it at the center of this relatively out.

29
00:01:52,860 --> 00:01:53,420
OK.

30
00:01:53,640 --> 00:01:55,700
So here is our tab host.

31
00:01:55,860 --> 00:02:02,710
And as you can see let's actually go back go to our text tab here and here is the code.

32
00:02:02,730 --> 00:02:08,890
The lines of code that are related to the user interface and here as you can see we have this tab host.

33
00:02:08,910 --> 00:02:09,560
OK.

34
00:02:09,870 --> 00:02:16,710
And if you have a linear layout vertical inside that table top host we have this tab widget as you can

35
00:02:16,710 --> 00:02:17,370
see.

36
00:02:17,550 --> 00:02:21,540
And we have this frame layout inside that tab widget as you can see here.

37
00:02:21,630 --> 00:02:25,700
And we have this frame layout inside this linearly out here.

38
00:02:26,010 --> 00:02:31,520
And we have also some linearly outs inside these linearly out vertical.

39
00:02:31,530 --> 00:02:34,640
So let's actually delete this linearly else here.

40
00:02:34,680 --> 00:02:38,220
I'll talk more about this later for now just delete them.

41
00:02:38,280 --> 00:02:45,990
So now I have only a tab host and inside that tab host we have this vertical linearly out and inside

42
00:02:45,990 --> 00:02:50,660
that vertical linearly out we have this tab widget and frameless out.

43
00:02:50,720 --> 00:02:54,660
OK so now let's actually to go back to our design.

44
00:02:54,690 --> 00:02:57,000
So here is our user interface.

45
00:02:57,000 --> 00:03:01,700
And as you can see here we have these user interface components in our screen.

46
00:03:01,800 --> 00:03:07,300
So let's actually to select this tab host here and now I want to actually give an idea to the top post.

47
00:03:07,320 --> 00:03:13,530
So as you can see here this is the id attribute of this tab host and the default is tab host.

48
00:03:13,590 --> 00:03:14,830
And I think that's OK.

49
00:03:14,910 --> 00:03:15,480
OK.

50
00:03:15,750 --> 00:03:19,640
So let's actually go back to our main activity the java file here.

51
00:03:19,680 --> 00:03:22,310
So here we're going to actually put in some lines of code here.

52
00:03:22,410 --> 00:03:26,610
So now I'm going to paste in some lines of code and then I'm going to explain to you what's going on

53
00:03:26,610 --> 00:03:27,210
here.

54
00:03:27,210 --> 00:03:34,590
So inside our main activity class first of all we need to actually extend from the activity group class.

55
00:03:34,590 --> 00:03:37,930
Ok not an accomplished activity activity group.

56
00:03:37,950 --> 00:03:38,850
So let's actually did it.

57
00:03:38,860 --> 00:03:40,400
These are computer activity.

58
00:03:40,680 --> 00:03:44,140
And change it to Activity Group.

59
00:03:44,880 --> 00:03:45,180
OK.

60
00:03:45,180 --> 00:03:47,240
And that person entered here on your keyboard.

61
00:03:47,310 --> 00:03:50,210
So as you can see here it is deprecated.

62
00:03:50,400 --> 00:03:56,550
And so as a developer you need to know how to actually work with this activity group.

63
00:03:56,700 --> 00:03:58,890
But for now we use this activity.

64
00:03:59,010 --> 00:04:06,780
And then later in this tutorial I'll talk more about using other ways in order to use taphouse in our

65
00:04:06,780 --> 00:04:07,800
application.

66
00:04:07,830 --> 00:04:10,270
But for now we want to use activity group.

67
00:04:10,380 --> 00:04:15,540
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

68
00:04:15,540 --> 00:04:16,320
on here.

69
00:04:16,650 --> 00:04:20,620
So as you can see here these are the two lines of code that I actually paste that here.

70
00:04:20,640 --> 00:04:23,990
First of all I created an object of type Paphos.

71
00:04:24,030 --> 00:04:24,730
OK.

72
00:04:24,900 --> 00:04:26,210
Assignment operator.

73
00:04:26,250 --> 00:04:33,630
So I actually cast this object to a tab host object find view by ID or that ID that have host.

74
00:04:33,630 --> 00:04:38,860
So here I am actually referring to this tab host that I have inside are exemplified.

75
00:04:38,910 --> 00:04:39,420
OK.

76
00:04:39,550 --> 00:04:41,540
Inside these are relatively out.

77
00:04:41,880 --> 00:04:44,520
So here I have this taphouse object.

78
00:04:44,670 --> 00:04:49,530
And here in line 16 I am referring to this object tab host that's set up.

79
00:04:49,560 --> 00:04:53,380
So here I want to set up the tab host for my application.

80
00:04:53,610 --> 00:04:59,030
And here I call this if it gets activity local get local activity manager.

81
00:04:59,250 --> 00:05:02,240
So this before comes from this activity group class.

82
00:05:02,270 --> 00:05:05,520
So if you to the poll to come and keep on my keyboard.

83
00:05:05,540 --> 00:05:09,800
So if you are using a Windows machine you need to hold the controls on your keyboard.

84
00:05:09,910 --> 00:05:14,630
Here I just need to hold the command key and then present this method here.

85
00:05:14,630 --> 00:05:17,770
And as you can see here I have this activity group that over here.

86
00:05:17,990 --> 00:05:20,680
And as you can see this lever is inside this file.

87
00:05:20,720 --> 00:05:22,450
Get local activity manager.

88
00:05:22,760 --> 00:05:30,080
So here I need to actually get this Mefford get local activity manager in order to actually manage my

89
00:05:30,080 --> 00:05:30,770
activity.

90
00:05:30,860 --> 00:05:31,470
OK.

91
00:05:31,640 --> 00:05:36,290
So here I'm going to put paste in some more lines of code and then I'm going to explain to you what's

92
00:05:36,290 --> 00:05:37,150
going on here.

93
00:05:37,280 --> 00:05:43,070
So as you can see here these are the lines of code that I actually passed that I pasted here.

94
00:05:43,370 --> 00:05:46,480
So here as you can see in line to anyone.

95
00:05:46,580 --> 00:05:49,330
I created an object of type papped spec.

96
00:05:49,340 --> 00:05:52,290
OK tab host tab spek.

97
00:05:52,520 --> 00:05:57,600
And the name of this object is spech assignment operator tab host.

98
00:05:57,620 --> 00:06:01,940
So here you referred to this tab host that Neal tab spit.

99
00:06:02,000 --> 00:06:05,990
OK so I want to actually create some tabs in my application or.

100
00:06:06,140 --> 00:06:10,250
Like a tab application so tab host that new tab spec.

101
00:06:10,280 --> 00:06:14,620
So here as you can see if you have this argument and this argument is attack.

102
00:06:14,660 --> 00:06:15,110
OK.

103
00:06:15,200 --> 00:06:20,170
And instead of double quotes as you can see I specified the tag of this type one.

104
00:06:20,390 --> 00:06:21,000
OK.

105
00:06:21,440 --> 00:06:29,480
And here I in line 22 I am specifying the indicator of the spec spec that set indicator type 1.

106
00:06:29,750 --> 00:06:34,040
So now I'm going to run our project and then I'm going to show you what is going to be this indicator

107
00:06:34,250 --> 00:06:41,400
and 11:23 I have this intense object so intense intent one new intent.

108
00:06:41,540 --> 00:06:44,840
So here I want to actually move from this activity to this activity.

109
00:06:44,840 --> 00:06:50,420
OK first that activity so main activity that this this is going to be our first activity and here I

110
00:06:50,420 --> 00:06:52,410
want to move to this activity.

111
00:06:52,490 --> 00:06:54,380
First that activity that class.

112
00:06:54,440 --> 00:06:59,050
So as you can see here we don't have this activity in our project so we need to create this activity

113
00:06:59,310 --> 00:07:06,210
and inline 24 I actually referred to this spec object that said content intent.

114
00:07:06,220 --> 00:07:06,870
1.

115
00:07:07,280 --> 00:07:07,800
OK.

116
00:07:07,910 --> 00:07:15,350
So I want to actually put this into one inside this spec OK for the content.

117
00:07:15,350 --> 00:07:23,810
And here I actually add this tab to this top host tab host that add tab spec as you can see here.

118
00:07:23,810 --> 00:07:28,120
So now let's actually create this first that activity in our project.

119
00:07:28,130 --> 00:07:35,390
So here in our project structure as you can see here I just click on this package here and right click

120
00:07:35,390 --> 00:07:35,910
on it.

121
00:07:36,190 --> 00:07:36,890
OK.

122
00:07:37,310 --> 00:07:38,870
And then here new.

123
00:07:39,180 --> 00:07:39,490
OK.

124
00:07:39,500 --> 00:07:45,770
And then click on it and as you can see we have this activity here and here I can just select is empty

125
00:07:45,770 --> 00:07:46,360
activity.

126
00:07:46,370 --> 00:07:47,270
OK.

127
00:07:47,870 --> 00:07:51,880
And for the name of our activity I am going to use this name here.

128
00:07:51,880 --> 00:08:01,160
First that activity as you can see here first tap activity and as you can see here it's going to actually

129
00:08:01,250 --> 00:08:09,320
automatically create another layout with this name activity underlined first underline tap and the package

130
00:08:09,320 --> 00:08:10,630
is going to be this package.

131
00:08:10,640 --> 00:08:11,230
OK.

132
00:08:11,630 --> 00:08:17,450
So now it says interactivity so I don't want this activity to be the lantern activity.

133
00:08:17,480 --> 00:08:20,490
I want the main activity to be that interactive with you OK.

134
00:08:20,540 --> 00:08:24,610
So don't check this checkbox here and then click on finish.

135
00:08:25,220 --> 00:08:29,380
So here as you can see we have this first that activity in our project.

136
00:08:29,480 --> 00:08:36,020
And as you can see here inside this manifest file we have this activity here inside this application

137
00:08:36,020 --> 00:08:36,500
tag.

138
00:08:36,620 --> 00:08:37,080
OK.

139
00:08:37,190 --> 00:08:39,830
And the name that first the that first that activity.

140
00:08:39,840 --> 00:08:40,680
OK.

141
00:08:41,210 --> 00:08:47,590
So as you can see here at the top of this manifest file if you have these ASML namespace.

142
00:08:47,830 --> 00:08:53,810
And here as you can see it specified the default package package and the name of this package is this

143
00:08:53,810 --> 00:08:54,560
package.

144
00:08:54,560 --> 00:08:59,200
So here it just put this dot here and then referred to this class.

145
00:08:59,210 --> 00:09:06,230
Inside this package OK if you would have this class in another package we would need to actually specify

146
00:09:06,500 --> 00:09:10,210
the entire name of the package that this class is inside.

147
00:09:10,400 --> 00:09:10,840
OK.

148
00:09:10,910 --> 00:09:17,480
But because this class is inside this package which we were just typing that first that activity as

149
00:09:17,480 --> 00:09:23,210
you can see here this first activity is inside this package that is that that its name is the same as

150
00:09:23,400 --> 00:09:24,690
that that this name here.

151
00:09:24,740 --> 00:09:25,160
OK.

152
00:09:25,190 --> 00:09:27,500
So hopefully that makes sense.

153
00:09:27,500 --> 00:09:28,910
And inside this may actually be the class.

154
00:09:28,910 --> 00:09:30,870
Now as you can see the error is gone.

155
00:09:30,980 --> 00:09:36,090
So now let's actually open this activity underlined first underline tappet example.

156
00:09:36,500 --> 00:09:38,850
And here as you can see this is our activity.

157
00:09:39,260 --> 00:09:45,800
And here now I'm going to actually drag a linearly out vertical So as you can see here inside this activity

158
00:09:45,800 --> 00:09:51,560
I have this linearly arithmetical here and here and when I put it at the center of this relatively out

159
00:09:51,560 --> 00:09:58,060
here but as you can see here I don't like the theme of this activity of this exemplify.

160
00:09:58,250 --> 00:10:05,000
So I just need to click on this app from here and then here I can just select this material light.

161
00:10:05,200 --> 00:10:05,860
OK.

162
00:10:06,120 --> 00:10:12,480
And here I can't just choose this material that light the dark action and then click on OK.

163
00:10:12,900 --> 00:10:22,230
OK so here this is our activity and we changed the theme of this XML file and now I want to actually

164
00:10:22,230 --> 00:10:27,380
drag our text view a large takes you into this XML file.

165
00:10:27,390 --> 00:10:32,310
So I just need to put it at the center of this linearly Attaway article that I need.

166
00:10:32,940 --> 00:10:42,790
And for the text just type in here this is first tap OK and in person enter key on your keyboard.

167
00:10:43,150 --> 00:10:46,670
So now let's actually go back to our main activity the Java file here.

168
00:10:46,750 --> 00:10:50,770
So first of all let's actually run our project and see what happens.

169
00:10:50,770 --> 00:10:55,020
So as you can see here now our application is running on this emulator.

170
00:10:55,060 --> 00:10:56,850
And here is our tab 1.

171
00:10:56,920 --> 00:11:02,170
So here as you can see be assigned this value for this indicator Tab 1.

172
00:11:02,170 --> 00:11:04,090
And here this is our first tab.

173
00:11:04,090 --> 00:11:04,620
OK.

174
00:11:04,630 --> 00:11:08,170
So this is the value that we actually put inside this activity.

175
00:11:08,170 --> 00:11:10,960
Underline first underline tab that SML.

176
00:11:10,980 --> 00:11:14,430
OK but here as you can see we have this action bar here.

177
00:11:14,440 --> 00:11:14,870
OK.

178
00:11:14,980 --> 00:11:17,440
But I don't like this to be here.

179
00:11:17,470 --> 00:11:20,920
So let's actually go back to our and manifested XML file here.

180
00:11:21,040 --> 00:11:28,430
So here we have this activity that main activity here and here I have to specify a field for this activity.

181
00:11:28,690 --> 00:11:35,390
So here I can just typing Feme and I can just type in no action bar.

182
00:11:35,680 --> 00:11:40,440
So as you can see here it says find that Afkham pads that light that no action.

183
00:11:40,600 --> 00:11:45,030
So just select this and put press Enter key on your keyboard.

184
00:11:45,070 --> 00:11:48,180
So now let's actually go on our project and see what happens.

185
00:11:48,250 --> 00:11:54,130
So here as you can see our application is running on the simulator and we can see this tab one here.

186
00:11:54,130 --> 00:12:01,240
And this is our text inside these tab one here or key activity underlined first that underline tab that

187
00:12:01,260 --> 00:12:01,700
SML.

188
00:12:01,720 --> 00:12:07,480
OK so now let's actually go back to our main activity that our fight here because I want to add some

189
00:12:07,480 --> 00:12:09,770
more caps to my application.

190
00:12:09,940 --> 00:12:11,990
So this is our first stop OK.

191
00:12:12,010 --> 00:12:14,760
So here I want to create the second tab.

192
00:12:14,920 --> 00:12:19,600
So now I'm going to actually paste in some more lines of code here and then I'm going to explain to

193
00:12:19,600 --> 00:12:21,120
you what's going on here.

194
00:12:21,520 --> 00:12:26,950
So as you can see here these are the lines of code that I actually pasted here and here as you can see.

195
00:12:26,950 --> 00:12:32,760
Again I referred to the name of this space object that I actually created in line 21.

196
00:12:32,860 --> 00:12:40,330
As you can see here top post the top spec and here I have this spec top post that new top spec one.

197
00:12:40,510 --> 00:12:42,580
OK so this is the tag for this top.

198
00:12:42,580 --> 00:12:43,280
OK.

199
00:12:43,630 --> 00:12:52,030
And here I actually again referred to this spec object assignment operator tab host that new tab spek

200
00:12:52,180 --> 00:12:52,860
to.

201
00:12:53,200 --> 00:12:53,470
OK.

202
00:12:53,470 --> 00:12:59,750
As you can see here we have this value too as the tag of these are Meffert new top spec.

203
00:12:59,980 --> 00:13:05,380
And here as you can see in line for it to again I referred to the name of this space object that set

204
00:13:05,420 --> 00:13:07,210
indicator tap to.

205
00:13:07,420 --> 00:13:08,120
OK.

206
00:13:08,500 --> 00:13:09,920
And in line for free.

207
00:13:09,940 --> 00:13:16,420
I actually created another intense object and the name of this intense object is intense to assignment

208
00:13:16,450 --> 00:13:18,200
operator new intent.

209
00:13:18,220 --> 00:13:24,040
So this is going to be the activity the first activity that you want to actually transfer transfer from

210
00:13:24,470 --> 00:13:26,020
so main activity that this.

211
00:13:26,260 --> 00:13:31,470
And here it is going to be the second activity that you want to actually transfer to.

212
00:13:31,570 --> 00:13:32,100
OK.

213
00:13:32,320 --> 00:13:36,250
So I want to move from this activity main activity to the second activity.

214
00:13:36,250 --> 00:13:37,780
So as you can see here we have an error.

215
00:13:37,810 --> 00:13:44,620
So we need to actually create this second type activity here in our project and in line 34.

216
00:13:44,650 --> 00:13:50,440
I again referred to the name of this spec object that said content intent to.

217
00:13:50,650 --> 00:13:51,480
OK.

218
00:13:51,820 --> 00:13:53,400
And again inline 35.

219
00:13:53,440 --> 00:13:58,290
I added this tab to this tab host tab host that tab speech.

220
00:13:58,720 --> 00:13:59,550
OK.

221
00:13:59,740 --> 00:14:01,060
So hopefully that makes sense.

222
00:14:01,060 --> 00:14:06,310
And now let's actually create this second tab activity in our project.

223
00:14:06,310 --> 00:14:16,090
So just click on this package here conduct example here and then click on File new here click on activity

224
00:14:16,570 --> 00:14:21,670
and then choose empty activity and the for the name of your activity name.

225
00:14:21,670 --> 00:14:22,710
Just type in here.

226
00:14:22,720 --> 00:14:24,330
Second tap activity.

227
00:14:24,460 --> 00:14:25,310
OK.

228
00:14:25,810 --> 00:14:32,320
And here as you can see we have our lay out name activity underlined second underline tab and here it

229
00:14:32,320 --> 00:14:33,770
says generate outfight.

230
00:14:33,780 --> 00:14:36,820
OK it's really important that you actually check this checkbox.

231
00:14:36,880 --> 00:14:40,610
Otherwise it's not going to generate a out file for us.

232
00:14:40,630 --> 00:14:47,150
So now click on finish and as you can see here we have this second type activity and we have also the

233
00:14:47,150 --> 00:14:54,080
Smurfette set content view are that lay out that activity underline say can't underline tap and in say

234
00:14:54,080 --> 00:14:55,280
does mean activity class.

235
00:14:55,280 --> 00:14:57,620
Now as you can see the error is gone.

236
00:14:57,890 --> 00:15:01,650
So now let's actually open our Android manifest.

237
00:15:01,660 --> 00:15:06,400
Here again as you can see we have this line of code automatically here.

238
00:15:06,410 --> 00:15:11,930
This line of code is actually automatically generated for us by the ID activity Android name.

239
00:15:12,040 --> 00:15:13,250
That's second type activity.

240
00:15:13,250 --> 00:15:13,710
OK.

