1
00:00:05,290 --> 00:00:06,470
In the previous video

2
00:00:06,470 --> 00:00:08,910
we set up our Hello World application

3
00:00:08,910 --> 00:00:10,710
and what I want to do now is take you through

4
00:00:10,710 --> 00:00:13,040
setting up the emulator, so that when we get to

5
00:00:13,040 --> 00:00:16,640
the next video we can run this application.

6
00:00:16,640 --> 00:00:19,170
Now, Android Studio should have set up an emulator

7
00:00:19,170 --> 00:00:20,850
for you when you installed it.

8
00:00:20,850 --> 00:00:22,130
But I want to go through and show you

9
00:00:22,130 --> 00:00:24,090
how to do that again anyway.

10
00:00:24,090 --> 00:00:27,510
And that's because it's useful to know create new emulators

11
00:00:27,510 --> 00:00:29,330
so that you can download and test on different

12
00:00:29,330 --> 00:00:32,840
Android versions when you're going to release your app.

13
00:00:32,840 --> 00:00:35,470
So to get to the Android virtual device manager,

14
00:00:35,470 --> 00:00:37,860
you can either either click on this little button over here.

15
00:00:37,860 --> 00:00:41,050
Alternatively, you can click on Tools, Android,

16
00:00:41,050 --> 00:00:42,483
and select AVD manager.

17
00:00:43,470 --> 00:00:45,610
You can see that I've got a Android virtual device

18
00:00:45,610 --> 00:00:48,750
already set up, but I'm gonna delete that, as I mentioned,

19
00:00:48,750 --> 00:00:51,160
and walk through the process of creating it again.

20
00:00:51,160 --> 00:00:53,350
So, I'm gonna click on this little triangle

21
00:00:53,350 --> 00:00:56,180
that's on the far right, and that's because it's a menu.

22
00:00:56,180 --> 00:00:58,730
And from there, when I click on it, I can select delete,

23
00:00:58,730 --> 00:01:00,140
and click on yes.

24
00:01:00,140 --> 00:01:02,390
Now, if you've got everything deleted, like I have,

25
00:01:02,390 --> 00:01:04,910
you'll start off with a screen that looks like this.

26
00:01:04,910 --> 00:01:07,860
So let's come down here and click on Create Virtual Device.

27
00:01:09,480 --> 00:01:10,840
And I'll just expand this a little bit bigger,

28
00:01:10,840 --> 00:01:12,780
so I can see it a bit better.

29
00:01:12,780 --> 00:01:16,020
Now, I'm going to choose the Nexus 5X here

30
00:01:16,020 --> 00:01:17,450
for a few reasons.

31
00:01:17,450 --> 00:01:20,060
Firstly, it's a good one for testing purposes.

32
00:01:20,060 --> 00:01:21,610
And secondly, it's the device that,

33
00:01:21,610 --> 00:01:24,130
the physical device that I actually own.

34
00:01:24,130 --> 00:01:25,460
Now, if you're a bit short on memory,

35
00:01:25,460 --> 00:01:27,020
or you've got a slow computer,

36
00:01:27,020 --> 00:01:29,710
then you may be better off with something like the Nexus 4

37
00:01:29,710 --> 00:01:31,830
that uses less resources.

38
00:01:31,830 --> 00:01:35,730
And this Play Store column is actually quite important

39
00:01:35,730 --> 00:01:37,820
because it tells us which devices can access the

40
00:01:37,820 --> 00:01:39,700
Google Play Store.

41
00:01:39,700 --> 00:01:42,770
Now, at the time I'm recording this I need a Nexus 5,

42
00:01:42,770 --> 00:01:45,420
and the Nexus 5X emulators are able to download

43
00:01:45,420 --> 00:01:46,890
apps from the Play Store.

44
00:01:46,890 --> 00:01:49,280
Of course, that might change over time.

45
00:01:49,280 --> 00:01:52,180
Now, there are a couple of implications of that.

46
00:01:52,180 --> 00:01:53,960
The first one is that you can't instal apps from

47
00:01:53,960 --> 00:01:57,920
the Play Store on other devices, the Nexus 4 for example.

48
00:01:57,920 --> 00:02:00,010
But that's not normally a problem,

49
00:02:00,010 --> 00:02:01,790
because you usually use the emulator for

50
00:02:01,790 --> 00:02:03,390
testing your own apps,

51
00:02:03,390 --> 00:02:05,040
and we'll touch on that a little bit later.

52
00:02:05,040 --> 00:02:08,160
Now, another implication is to deal with route access.

53
00:02:08,160 --> 00:02:10,220
But don't worry about that at the moment,

54
00:02:10,220 --> 00:02:12,680
just be aware that there are things you can't do

55
00:02:12,680 --> 00:02:14,440
on the Play Store emulators.

56
00:02:14,440 --> 00:02:17,630
That's something else we'll discuss later in the of course.

57
00:02:17,630 --> 00:02:20,700
Once you've selected a device, click on next.

58
00:02:20,700 --> 00:02:23,040
So again, I'm selecting the Nexus 5X.

59
00:02:23,040 --> 00:02:25,060
And this next screen lets you choose

60
00:02:25,060 --> 00:02:26,750
which system image to use.

61
00:02:26,750 --> 00:02:29,770
And you can see at the top there's three tabs here.

62
00:02:29,770 --> 00:02:32,170
The first one is the recommended devices

63
00:02:32,170 --> 00:02:33,890
and you can download the images from here

64
00:02:33,890 --> 00:02:35,540
using the download link.

65
00:02:35,540 --> 00:02:38,560
So if I wanted to select the API 24 version,

66
00:02:38,560 --> 00:02:40,500
I could just click on download there.

67
00:02:40,500 --> 00:02:41,950
That would download, and then I would be able to

68
00:02:41,950 --> 00:02:43,687
access that, and use that.

69
00:02:43,687 --> 00:02:45,600
But in my case, you can see we've got one that

70
00:02:45,600 --> 00:02:47,580
hasn't got the download option, and that means that

71
00:02:47,580 --> 00:02:49,830
it's already been installed on this computer.

72
00:02:50,670 --> 00:02:53,350
You'll note that these devices over here to the right

73
00:02:53,350 --> 00:02:57,020
on the target have got Google Play in the target name.

74
00:02:57,020 --> 00:02:58,690
If we'd chosen a different model of phone

75
00:02:58,690 --> 00:03:01,350
on the previous screen, the target names probably

76
00:03:01,350 --> 00:03:02,940
wouldn't include Google Play.

77
00:03:02,940 --> 00:03:06,580
And this little tab up here for x86 images

78
00:03:06,580 --> 00:03:08,760
and also one for other images.

79
00:03:08,760 --> 00:03:12,080
Now, the x86 images does give you a lot of choice,

80
00:03:12,080 --> 00:03:15,650
but the decision's quite easy when you're starting off.

81
00:03:15,650 --> 00:03:18,540
Now, the easy one is if you're running Linux.

82
00:03:18,540 --> 00:03:21,280
If that's the case, you just choose an x86 image

83
00:03:21,280 --> 00:03:23,890
for Android O, Oreo.

84
00:03:23,890 --> 00:03:26,040
So you would choose this one if you're running Linux.

85
00:03:26,040 --> 00:03:28,850
You don't have to worry about HAXM or anything like.

86
00:03:28,850 --> 00:03:31,200
And if you've gone through the earlier video of checking

87
00:03:31,200 --> 00:03:34,490
and configuring of visualisation support, and you buy us,

88
00:03:34,490 --> 00:03:36,000
then there's really nothing more to be done.

89
00:03:36,000 --> 00:03:39,590
Linux will happily use the x86 system images.

90
00:03:39,590 --> 00:03:41,830
Now, if you're running on a Mac or Windows

91
00:03:41,830 --> 00:03:45,070
then the x86 images will give the best performance,

92
00:03:45,070 --> 00:03:47,780
provided you manage to get HAXM installed.

93
00:03:47,780 --> 00:03:50,320
Now if you did, then you're in the same position as

94
00:03:50,320 --> 00:03:54,470
Linux users, so again, choose an x86 image.

95
00:03:54,470 --> 00:03:57,690
Now, if you're on Windows or Mac without HAXM

96
00:03:57,690 --> 00:04:00,260
the x86 emulators won't run,

97
00:04:00,260 --> 00:04:03,400
but will refuse to start because HAXM isn't available.

98
00:04:03,400 --> 00:04:06,050
So, in that case, you should use the other images

99
00:04:06,050 --> 00:04:08,060
to use an ARM image.

100
00:04:08,060 --> 00:04:10,190
Now, all modern Mac's can run HAXM

101
00:04:10,190 --> 00:04:12,190
although you may need to instal the latest

102
00:04:12,190 --> 00:04:13,410
updates on your Mac.

103
00:04:13,410 --> 00:04:15,100
So, if you didn't manage to instal HAXM

104
00:04:15,100 --> 00:04:17,709
sort that out before continuing now.

105
00:04:17,709 --> 00:04:20,640
For Windows you can only instal HAXM if your computer

106
00:04:20,640 --> 00:04:24,260
has an Intel processor, and supports virtualization.

107
00:04:24,260 --> 00:04:26,910
So, if you've got an AMD processor, unfortunately you'll

108
00:04:26,910 --> 00:04:31,910
have to choose the armeabi-v7a image

109
00:04:32,210 --> 00:04:33,523
from the other images tab.

110
00:04:34,380 --> 00:04:37,780
Now these system images, these ARM system images,

111
00:04:37,780 --> 00:04:40,780
are unfortunately a lot slower than the x86 ones.

112
00:04:40,780 --> 00:04:43,810
So, only use these if you've got no other choice.

113
00:04:43,810 --> 00:04:46,790
In fact, it's worth checking out the Genymotion emulators

114
00:04:46,790 --> 00:04:50,260
instead, because these ARM images set in Android Studio

115
00:04:50,260 --> 00:04:52,030
are very slow indeed.

116
00:04:52,030 --> 00:04:54,763
Now, I'm gonna add a link to the Genymotion website.

117
00:04:55,710 --> 00:04:58,000
It's available at genymotion.com.

118
00:04:58,000 --> 00:05:00,800
So we'll quickly have a look at this Genymotion website.

119
00:05:02,140 --> 00:05:03,430
Paste that in, and this link will be in the

120
00:05:03,430 --> 00:05:06,073
resources section of this video.

121
00:05:07,030 --> 00:05:08,270
There's an option over here to click in

122
00:05:08,270 --> 00:05:10,160
the top right called Trial.

123
00:05:10,160 --> 00:05:12,830
So if I click on that, you'll be asked to register

124
00:05:12,830 --> 00:05:15,010
before you can actually download anything.

125
00:05:15,010 --> 00:05:16,830
Once you've registered, you need to find the link

126
00:05:16,830 --> 00:05:18,680
for the personal version.

127
00:05:18,680 --> 00:05:20,470
At the moment, that's on a button when you scroll

128
00:05:20,470 --> 00:05:23,520
down the page, but that way well change,

129
00:05:23,520 --> 00:05:26,100
so be prepared to hunt around the site to find it.

130
00:05:26,100 --> 00:05:28,040
But, again, that's only if you can't get

131
00:05:28,040 --> 00:05:30,525
some of these other system images to work.

132
00:05:30,525 --> 00:05:32,450
So, going back to Android Studio.

133
00:05:32,450 --> 00:05:34,650
If you can use the x86 system images that

134
00:05:34,650 --> 00:05:37,010
come with Android Studio, then I certainly

135
00:05:37,010 --> 00:05:38,880
recommend that you use them.

136
00:05:38,880 --> 00:05:41,340
Otherwise, check out the Genymotion emulator if you find

137
00:05:41,340 --> 00:05:44,300
the ARM system images are too slow.

138
00:05:44,300 --> 00:05:47,080
Now, if you're happy with working at the command prompt

139
00:05:47,080 --> 00:05:48,440
I'm gonna be putting some instructions on

140
00:05:48,440 --> 00:05:51,650
how to use the x86 emulators from a command prompt.

141
00:05:51,650 --> 00:05:53,760
Then I'm gonna let you run them on Windows without HAXM

142
00:05:53,760 --> 00:05:56,680
and it gives better performance than the ARM system images.

143
00:05:56,680 --> 00:05:59,420
But we'll add a document to the FAQ section

144
00:05:59,420 --> 00:06:00,960
explaining how to do that.

145
00:06:00,960 --> 00:06:03,720
Okay, so back to the x86 images.

146
00:06:03,720 --> 00:06:07,780
So I'm going to use the Oreo image, API 26.

147
00:06:07,780 --> 00:06:11,760
The target here is Android 8,

148
00:06:11,760 --> 00:06:13,840
Google API, as you can see there.

149
00:06:13,840 --> 00:06:16,280
So note that Google APIs isn't the same thing

150
00:06:16,280 --> 00:06:17,700
as Google Play.

151
00:06:17,700 --> 00:06:19,670
So this emulator won't be able to

152
00:06:19,670 --> 00:06:21,430
access the Google Play store.

153
00:06:21,430 --> 00:06:22,790
So that's fine, I'm going to using this

154
00:06:22,790 --> 00:06:25,260
emulator for most of the apps in this course.

155
00:06:25,260 --> 00:06:27,780
But we will be installing a Play Store emulator

156
00:06:27,780 --> 00:06:29,610
for the YouTube app a little bit later.

157
00:06:29,610 --> 00:06:32,070
So, if you've got this option here, and there's a download

158
00:06:32,070 --> 00:06:34,600
link, you'll need to click it at this point.

159
00:06:34,600 --> 00:06:37,310
In my case it's already downloaded, so I can just click on

160
00:06:37,310 --> 00:06:41,270
next after making sure that the Oreo version API level 26

161
00:06:41,270 --> 00:06:44,250
is selected, clicking on next.

162
00:06:44,250 --> 00:06:46,080
Now, it's here that we get the chance to change

163
00:06:46,080 --> 00:06:48,910
the configuration, and you've got a few options here.

164
00:06:48,910 --> 00:06:51,300
So I'm gonna go through and explain what they are.

165
00:06:51,300 --> 00:06:53,630
Firstly, the AVD name.

166
00:06:53,630 --> 00:06:56,040
Now, you can change that to something else if you want to,

167
00:06:56,040 --> 00:06:57,810
but the suggested name is pretty good

168
00:06:57,810 --> 00:07:00,750
unless you create a lot of emulators.

169
00:07:00,750 --> 00:07:02,810
Then it's a good idea to use a name that describes it

170
00:07:02,810 --> 00:07:04,770
a bit better, so you know what all your

171
00:07:04,770 --> 00:07:06,950
Nexus images are, for example.

172
00:07:06,950 --> 00:07:08,226
The default name's fine here,

173
00:07:08,226 --> 00:07:09,360
so I'm just gonna leave it as that.

174
00:07:09,360 --> 00:07:12,090
Alright, so there's another chance here to choose

175
00:07:12,090 --> 00:07:14,187
a different device by clicking the change button.

176
00:07:14,187 --> 00:07:17,130
And I could also choose a different version of Android

177
00:07:17,130 --> 00:07:18,740
if I had the images downloaded.

178
00:07:18,740 --> 00:07:20,290
And that'll just show a screen similar to

179
00:07:20,290 --> 00:07:23,470
the previous one, so I'm gonna leave them both as they are.

180
00:07:23,470 --> 00:07:26,230
And this next section down here, you can actually choose,

181
00:07:26,230 --> 00:07:28,440
you can change the orientation,

182
00:07:28,440 --> 00:07:30,890
but you can also do that while the device is running.

183
00:07:30,890 --> 00:07:33,470
So if you've created a tablet instead of a phone,

184
00:07:33,470 --> 00:07:35,890
then landscape would make more sense as the default

185
00:07:35,890 --> 00:07:38,330
orientation rather than portrait.

186
00:07:38,330 --> 00:07:41,010
Now the emulated performance down here,

187
00:07:41,010 --> 00:07:43,100
that's gonna let you use the host's GPU,

188
00:07:43,100 --> 00:07:44,890
the graphics processing unit,

189
00:07:44,890 --> 00:07:48,130
which can speed up the emulator display quite a lot.

190
00:07:48,130 --> 00:07:51,100
But it can also cause problems with some systems though.

191
00:07:51,100 --> 00:07:53,410
So it's best to leave it as I've got it on automatic

192
00:07:53,410 --> 00:07:56,820
to start with, but if you do get GPU or GL errors when

193
00:07:56,820 --> 00:07:59,080
running the emulator, then come back here and change

194
00:07:59,080 --> 00:08:01,020
it to software instead.

195
00:08:01,020 --> 00:08:03,490
And that prevents the emulator from attempting to use

196
00:08:03,490 --> 00:08:06,540
your graphics card processor if there are problems.

197
00:08:06,540 --> 00:08:08,560
Now, also try software if your emulator hangs

198
00:08:08,560 --> 00:08:09,950
and doesn't fully start up.

199
00:08:09,950 --> 00:08:12,030
Sometimes that fixes the problem.

200
00:08:12,030 --> 00:08:14,453
Now, if HAXM isn't installed on Windows,

201
00:08:14,453 --> 00:08:16,023
then select software.

202
00:08:16,860 --> 00:08:19,460
Without HAXM, hardware often doesn't work.

203
00:08:19,460 --> 00:08:22,640
The emulator isn't always good at detecting that,

204
00:08:22,640 --> 00:08:25,650
so it's best to set it explicitly here in that scenario.

205
00:08:25,650 --> 00:08:28,090
And this device frame, that looks nice on the screen,

206
00:08:28,090 --> 00:08:29,600
so I'm gonna leave that ticked.

207
00:08:29,600 --> 00:08:32,559
It's really just eye candy though, so on slower machines

208
00:08:32,559 --> 00:08:35,929
it's probably worth un-ticking to save for some resources.

209
00:08:35,929 --> 00:08:38,429
And the show advanced settings button lets you configure

210
00:08:38,429 --> 00:08:41,460
things like the amount of RAM to allocate for the emulator.

211
00:08:41,460 --> 00:08:42,982
If I click on that and have a look,

212
00:08:44,400 --> 00:08:46,690
scroll down a little bit, you can see that

213
00:08:46,690 --> 00:08:50,340
currently it's defaulting to 1,536 megabytes,

214
00:08:50,340 --> 00:08:52,820
that's one and a half gig, that the emulator will use

215
00:08:52,820 --> 00:08:54,470
from your system resources.

216
00:08:54,470 --> 00:08:56,930
So on a four gig system, you're gonna give a lot of

217
00:08:56,930 --> 00:08:58,460
memory to the emulator.

218
00:08:58,460 --> 00:09:00,800
You might want to knock that down a lot in that scenario.

219
00:09:00,800 --> 00:09:03,940
One gig or even 768 meg might work better

220
00:09:03,940 --> 00:09:05,580
on a system with low memory.

221
00:09:05,580 --> 00:09:08,590
Now the VM heap is needed for the Java runtime

222
00:09:08,590 --> 00:09:10,850
on the device, the emulator, and comes out of the

223
00:09:10,850 --> 00:09:13,240
total memory that you've allocated.

224
00:09:13,240 --> 00:09:16,070
Now internal storage uses a file on your hard drive,

225
00:09:16,070 --> 00:09:19,760
so this 800 megabytes here isn't coming out of your memory.

226
00:09:19,760 --> 00:09:21,840
There's not really anything gained from increasing it,

227
00:09:21,840 --> 00:09:24,080
so unless you intend to instal hundred of apps on the

228
00:09:24,080 --> 00:09:27,130
emulator, I'd say leave it unchanged.

229
00:09:27,130 --> 00:09:30,410
And specifying an external file for the SD card is an

230
00:09:30,410 --> 00:09:32,860
advanced thing to do, and there's not much point in

231
00:09:32,860 --> 00:09:34,420
changing that at this stage either.

232
00:09:34,420 --> 00:09:36,110
You do that if you wanted to sort of pretend you're

233
00:09:36,110 --> 00:09:37,950
taking it out of the emulator and plugged it into

234
00:09:37,950 --> 00:09:40,460
your computer, like you could do with a real SD card.

235
00:09:40,460 --> 00:09:41,790
But that's not something we're

236
00:09:41,790 --> 00:09:44,040
gonna be doing in this course.

237
00:09:44,040 --> 00:09:46,200
Now, when I clicked that show advanced settings option,

238
00:09:46,200 --> 00:09:48,420
the device frame options moved.

239
00:09:48,420 --> 00:09:51,280
You can create custom skins for the emulator.

240
00:09:51,280 --> 00:09:53,460
That's just eye candy, really, but

241
00:09:53,460 --> 00:09:55,390
it can be useful when you've to publish your app

242
00:09:55,390 --> 00:09:57,410
because you can capture a screenshot of it

243
00:09:57,410 --> 00:09:58,810
running on an emulator,

244
00:09:58,810 --> 00:10:00,330
and obviously that'll look better if it looks like a

245
00:10:00,330 --> 00:10:02,970
real device, rather than just a square box.

246
00:10:02,970 --> 00:10:04,850
So when the time comes for you to publish apps on the

247
00:10:04,850 --> 00:10:07,070
Google Play Store, then certainly play around

248
00:10:07,070 --> 00:10:08,890
with skins if you want.

249
00:10:08,890 --> 00:10:11,000
This is the section I'm talking about down here,

250
00:10:11,000 --> 00:10:12,770
but we're just starting out so either just accept

251
00:10:12,770 --> 00:10:15,110
the ones suggested that I'm gonna do,

252
00:10:15,110 --> 00:10:17,100
or you can un-tick enable device frame if you want to

253
00:10:17,100 --> 00:10:19,040
speed things up a little, and give your computer

254
00:10:19,040 --> 00:10:20,520
less work to do.

255
00:10:20,520 --> 00:10:22,150
So, finally, down here there's this option

256
00:10:22,150 --> 00:10:24,480
for enable keyboard input.

257
00:10:24,480 --> 00:10:26,410
Well that box lets you use the computers keyboard

258
00:10:26,410 --> 00:10:28,190
to type into the emulator.

259
00:10:28,190 --> 00:10:30,220
So that's quicker than using the emulators onscreen

260
00:10:30,220 --> 00:10:33,640
keyboard, but can alter the way your app works.

261
00:10:33,640 --> 00:10:36,180
So, I definitely recommend testing your app on an emulator

262
00:10:36,180 --> 00:10:39,780
that has this option un-ticked, so you get a feel of how it

263
00:10:39,780 --> 00:10:42,210
behaves on the majority of devices.

264
00:10:42,210 --> 00:10:44,550
Most users don't connect an external keyboard to

265
00:10:44,550 --> 00:10:47,730
their phones, which is basically what this option is doing.

266
00:10:47,730 --> 00:10:50,400
It's a big force to use the same keyboard as your users

267
00:10:50,400 --> 00:10:52,900
can reveal some unexpected behaviour.

268
00:10:52,900 --> 00:10:54,930
Now, it's much quicker to type on a computer keyboard

269
00:10:54,930 --> 00:10:58,210
though, so I'm gonna leave this box ticked for now.

270
00:10:58,210 --> 00:11:01,200
So, once you've got everything selected and set up,

271
00:11:01,200 --> 00:11:05,740
click on finish, and the device manager sets everything up

272
00:11:05,740 --> 00:11:08,170
and takes you back to the main AVG screen,

273
00:11:08,170 --> 00:11:10,470
and you can now see our new device listed.

274
00:11:10,470 --> 00:11:14,080
So at the right over here are three icons,

275
00:11:14,080 --> 00:11:16,080
and we've already seen the little triangle down here

276
00:11:16,080 --> 00:11:18,180
that actually gives you a list of options.

277
00:11:18,180 --> 00:11:21,410
You can duplicate this AVD, you can wipe the data,

278
00:11:21,410 --> 00:11:23,940
you can show where it is on disc, view the details,

279
00:11:23,940 --> 00:11:27,510
or delete, or it can stop it if it's currently executing.

280
00:11:27,510 --> 00:11:29,280
But for the other two icons,

281
00:11:29,280 --> 00:11:32,550
the pencil icon will let you edit your emulator.

282
00:11:32,550 --> 00:11:34,526
So, if I click on that,

283
00:11:34,526 --> 00:11:36,360
and it just goes back to the screens

284
00:11:36,360 --> 00:11:38,370
that we were working on previously,

285
00:11:38,370 --> 00:11:40,790
and you can make changes to that emulator,

286
00:11:40,790 --> 00:11:41,920
but obviously you don't need to do that

287
00:11:41,920 --> 00:11:43,520
because we've just created it.

288
00:11:43,520 --> 00:11:46,260
Now this green triangle here, well that actually starts

289
00:11:46,260 --> 00:11:47,857
the emulator, so I'm gonna click that,

290
00:11:47,857 --> 00:11:49,407
and the emulator will start up.

291
00:11:51,410 --> 00:11:52,243
I'm just gonna move that over,

292
00:11:52,243 --> 00:11:54,113
I'm just gonna close that little screen down now.

293
00:11:54,113 --> 00:11:56,890
Now, it takes a little while for the emulator to start up,

294
00:11:56,890 --> 00:11:59,550
even on my Mac with 32 gigabytes of RAM.

295
00:11:59,550 --> 00:12:01,790
So, you may have to be patient depending on the speed

296
00:12:01,790 --> 00:12:04,390
and capacity of your computer.

297
00:12:04,390 --> 00:12:07,560
And it can take literally half an hour or longer

298
00:12:07,560 --> 00:12:09,460
to start an emulator up on some systems,

299
00:12:09,460 --> 00:12:11,050
so it's a good idea to start it before you

300
00:12:11,050 --> 00:12:12,530
actually start coding.

301
00:12:12,530 --> 00:12:15,923
That way it's up and going, and it's ready for you to use.

302
00:12:16,758 --> 00:12:19,660
Now I'm gonna let Android Studio launch the emulator for us,

303
00:12:19,660 --> 00:12:21,660
so I'm gonna close this one down for now.

304
00:12:21,660 --> 00:12:23,930
But if your emulator takes a long time to start then launch

305
00:12:23,930 --> 00:12:27,160
one from here so that it's available when you need it.

306
00:12:27,160 --> 00:12:29,360
So I'm just gonna click on over here, click on close,

307
00:12:29,360 --> 00:12:31,833
hold the button down, and select power off.

308
00:12:33,000 --> 00:12:35,610
Now that's shut down the emulator, they send you a little

309
00:12:35,610 --> 00:12:38,390
confirmation in the bottom right hand corner.

310
00:12:38,390 --> 00:12:40,720
Now, the last thing I wanna point out is the three different

311
00:12:40,720 --> 00:12:44,490
types of system images in terms of their behaviours.

312
00:12:44,490 --> 00:12:48,440
Now the easiest place to see this is in the SDK manager.

313
00:12:48,440 --> 00:12:50,050
So I'm gonna come over here,

314
00:12:50,050 --> 00:12:53,323
tools, Android, SDK manager.

315
00:12:54,693 --> 00:12:56,500
And we're gonna come down here and click on show package

316
00:12:56,500 --> 00:12:58,530
details, make sure that's checked.

317
00:12:58,530 --> 00:12:59,740
And that's obviously available in the

318
00:12:59,740 --> 00:13:02,100
SDK platforms tab up here.

319
00:13:02,100 --> 00:13:04,130
Now, starting with Android 8,

320
00:13:04,130 --> 00:13:07,680
and ignoring the Android TV and Android Wear system images,

321
00:13:07,680 --> 00:13:10,053
you can see that we've got various system images available.

322
00:13:10,053 --> 00:13:11,800
Now, I don't know if Google is going to be releasing

323
00:13:11,800 --> 00:13:13,560
a Redmi, which is for Oreo,

324
00:13:13,560 --> 00:13:16,700
but, at the moment, I haven't got them available.

325
00:13:16,700 --> 00:13:20,190
But I have got are two Intel x86 images available,

326
00:13:20,190 --> 00:13:24,810
Googles APIs Intel x86 and Google Play Intel x86.

327
00:13:24,810 --> 00:13:26,410
And again, we're ignoring the

328
00:13:26,410 --> 00:13:29,850
Android TV Intel x86 Atom System Image.

329
00:13:29,850 --> 00:13:32,290
So if you need route access to the AVD,

330
00:13:32,290 --> 00:13:34,620
and we'll be seeing that later in this course,

331
00:13:34,620 --> 00:13:38,470
then we'll have to use the Google APIs system image.

332
00:13:38,470 --> 00:13:40,690
But if you need access to the Google Play Store

333
00:13:40,690 --> 00:13:42,643
so that you can instal apps on the device,

334
00:13:42,643 --> 00:13:45,880
then you'll want to use the Google Play system image.

335
00:13:45,880 --> 00:13:47,740
There is a third variant,

336
00:13:47,740 --> 00:13:50,303
and we can see in the Android 4.2 section,

337
00:13:52,050 --> 00:13:55,170
all the way down here there's an Intel x86 system image

338
00:13:55,170 --> 00:13:58,670
with neither Google APIs or Google Play APIs.

339
00:13:58,670 --> 00:14:02,203
You can see here just Intel x86 Atom System Image.

340
00:14:03,070 --> 00:14:05,870
In the YouTube section of this course I'm gonna be using

341
00:14:05,870 --> 00:14:08,730
the API 17 version of this system image,

342
00:14:08,730 --> 00:14:11,810
Android 4.2, and I'm only going to be using that to

343
00:14:11,810 --> 00:14:14,220
show you an error we'll get because YouTube

344
00:14:14,220 --> 00:14:16,390
isn't installed on this system image.

345
00:14:16,390 --> 00:14:18,290
It's also a good version to check when we look at

346
00:14:18,290 --> 00:14:20,700
material design in section nine.

347
00:14:20,700 --> 00:14:22,220
Now, starting from the top again,

348
00:14:22,220 --> 00:14:24,820
the system images we're gonna be using are the

349
00:14:24,820 --> 00:14:27,570
two Android 8 Oreo ones.

350
00:14:27,570 --> 00:14:31,000
The Google API Intel x86 Atom System Image,

351
00:14:31,000 --> 00:14:33,870
and the Google Play Intel x86 Atom System Image,

352
00:14:33,870 --> 00:14:35,720
that's from Android 8.

353
00:14:35,720 --> 00:14:39,040
And under Android Nougat, we're also gonna be using

354
00:14:39,040 --> 00:14:42,220
the Google APIs Intel x86 Atom.

355
00:14:42,220 --> 00:14:45,620
And as I mentioned, right down to Android 4.2,

356
00:14:45,620 --> 00:14:47,530
we're going to be using this one as well.

357
00:14:47,530 --> 00:14:50,030
Now, if you're running Windows and can't get HAXM working,

358
00:14:50,030 --> 00:14:52,460
then you won't be able to use the x86 system images

359
00:14:52,460 --> 00:14:53,800
from Android Studio.

360
00:14:53,800 --> 00:14:55,360
There is a way to run them from the command line,

361
00:14:55,360 --> 00:14:56,680
and I'm gonna be putting a document in the

362
00:14:56,680 --> 00:14:59,270
FAQ section describing how to do that.

363
00:14:59,270 --> 00:15:01,470
And it'll also describe some other options

364
00:15:01,470 --> 00:15:02,690
for you to consider as well.

365
00:15:02,690 --> 00:15:05,040
So that's emulators, we've now got one installed.

366
00:15:05,040 --> 00:15:06,880
Let's move onto the next video.

367
00:15:06,880 --> 00:15:08,470
We're gonna actually get our Hello World app

368
00:15:08,470 --> 00:15:10,450
running on this emulator.

369
00:15:10,450 --> 00:15:12,053
So, I'll see you in the next video.

