>> Welcome back everyone to The Xamarin Show.
I'm your host, James Montemagno, and today,
we're going to take a look at how we can actually
manage and create brand
new Android emulators with
the latest updates to our Android emulator manager.
[MUSIC] So, let's hop over to Visual Studio 2017 and take a look.
So here, I am inside of Visual Studio and
when you want to deploy an Android application,
you're going to need a physical device or an emulator.
So, when you install Visual Studio,
you'll get a few default Android emulators,
but you can create your own.
So, under "Tools", "Android",
you'll see the "Android Device Manager",
"SDK Manager", and a few other options.
Let me first pull up the "Android SDK Manager".
This will show us all of the Android SDKs that are available
for you to install including Android emulator images.
Additionally, under "Tools", we'll
see the Android emulator version here.
So, I've installed the latest version,
you can always come in here as it's getting updated regularly.
Now, I don't have any updates available or else
you'd see a little button on the bottom left that would say,
"Install Updates" and it would handle everything for you.
So since we have everything installed,
let's go ahead and take a look at the emulators that we have.
Back under "Tools", "Android",
we'll go into the "Android Device Manager".
This will bring up our Device Manager,
which will show us all of the current
Android emulators that are on on our machine.
Here, we have an Accelerated Oreo
and another one that I've just created,
one with Google Play.
So, you can see what's interesting here is that we
get a little bit of information about the OS,
the processor, and how much RAM we have.
I can click on one,
and tap on "Edit",
and this will bring up the settings including the name for
this Android emulator and all the settings.
Additionally, it'll show us if we want to have
the Google APIs or the Google Play Store installed on the device.
These are all different versions or
different images that are available for the Android emulator.
So, instead of just running one,
let's create a brand new one and see
what the experience here would look like.
Now, on the left-hand side, we'll see a "Name".
So, let's say, "My KitKat Device",
will be the name that'll show up in Visual Studio.
I can select the type of device that I want,
so whether it's an Android Wear,
Android TV, Pixel series.
We'll just go with the Nexus five for now,
the default flavor if you will for resolution.
Here, we can notice that the LCD height and width is 1080p,
and the density is 420.
We'll go with x86, that's the default,
which will give us the hyper fast emulators.
I can also choose 64-bit or arm versions,
but you mostly want to stick to
x86 because that will give you the fastest.
Here, I can select the operating system that I want.
Now, notice that this shows me all different OS versions
even if I don't have that image readily available.
So here, I'm going to select on "Kit Kat" and notice that it says,
"A new device image will be downloaded."
It has identified that "Hey,
this is an image for Android KitKat API 19 that's available,
but I don't have it on my machine,
so it'll download it on demand."
Here, under all these properties,
these are physical properties of that emulator.
So, if I want the keyboard, the LCD,
I can click on any of them and get information.
Most likely, you must usually just keep things as the default.
You may want to adjust your RAM size, for instance.
Or you can come and add additional property.
There's lot of configuration inside of here.
So, we're just going to create this default.
Hit "Create" and then it will prompt me to say,
"Hey, this Intel x86 image does not exist.
Here's the terms and conditions."
We'll hit "Accept", and that'll go and
download this image on demand for me.
We see the new "My KitKat Device" targeting Kit Kat 4.4 - API 19,
a gig of RAM, and 1080p as the resolution.
So, it will download that image,
create the image and the emulator on my local machine,
and then it will be ready to use.
Notice that I can tap on any of the other ones.
I'll just hover over and start them here.
The creation process and downloading process can take
a few seconds up to a minute or more base on your internet speed.
Here, inside the Channel nine,
have pretty good Internet.
So, give us a few seconds to finish creating.
So now, our device is created and
all we have to do is hit "Start".
This will launch the Android emulator on our machine.
Now, what's great here is while it's
booting for the very first time,
it'll initialize and it only has to do that once.
The newer Android emulators save and
load state based on your last action.
So here, I can hit "OK".
I can go ahead and play around with it.
I have my full Android emulator.
Those will show up inside of Visual Studio or I could
launch it again from our Android emulator manager.
Now, what's great about these,
when I click on this "More",
I get all sorts of options to interact
with the Android emulator such as battery level,
phone, direction pad, microphone,
and even virtual sensors.
I can rotate the device in real time.
So, if I'm interacting with accelerometer compass, I can see that.
Additionally, under "Snapshots",
I can take snapshots on my device,
I can do screen recordings,
and I can modify my settings here.
Now, what I do love is that when I save this and close it down,
it'll save the state and when I boot it up
again from Visual Studio or from the device manager,
boom, it's good to go.
Now, I do want to point out that I'm actually
running Docker on this machine.
So, I'm running Hyper-V.
I'm running the Google Android emulator
and Docker at the same time.
This is because I've enabled hardware acceleration.
So here, inside of our docs at docs.microsoft.com,
and I'll put a link in the show that's below,
I can see how I can actually enable brand
new Hyper-V support for Android emulators.
So that means regardless if you're on
an Intel or on an AMD machine,
you can use Hyper-V as
the default virtualization platform on Windows to enable it.
If you're on a Mac, don't worry,
the Intel HAXM virtualization software
will give you super fast performance
there too and it's on by default.
So, there you have it. Managing, setting up,
and creating your Android emulator images inside of Visual Studio,
and just a few button clicks,
and seeing how to use them with Hyper-V, which is super awesome.
So, you can do your Docker development
and Xamarin development side-by-side.
So that's it for this week's episode.
Make sure you subscribe.
Click over there. Ding over there.
You know what to do.
Get those notifications in your inbox.
So, till next time, I'm James Montemagno.
This is The Xamarin Show and
thanks for watching [MUSIC].