Send this video I'm going to show you how to set up a
An Android emulator
The Android emulator is a virtual device that runs in your car
In other words it's a piece of software that pretends to have
All the hardware components
Of an actual phone
So why would you want to bother with this why would you want to set up an emulator on the 1st
One of the big reasons is that you don't have to have
Physical Android phone to test your apps out
So for example if you have a problem connecting the phone did you do on
You can always test your apps
On an emulator
You know say you're out and about your traveling or you're in a coffee shop
Forgot your cable
Well if you're not you can always test your apps
Second
You can test your apps on devices you don't actually own
Rights if you wanted to run the apps on the
Newest Samsung phone
You can
If you wanted to run your app on an Android web device
Again you can
Or say you wanted to test drive on an older version of Android
Or less powerful device
Then you can also do that
So let me later is actually really really handy when it comes to testing your app
Not to be clear
It's not a hundred percent
Replacement for actually going out
Testing your iPhone very slow
Different physical devices
But it helps a lot
Now silly
But actually honey for this course
If that you can run
The same app on two different devices simultaneously
Either on two different emulators
Around your physical device and emulator
So when you building the chat app later on in the coals
You can actually send chat messages
Twinbee emulator
On your phone
Okay so now we're ready to dive straight into the setup
First
Is checking
What processor
Your computer actually has
So this is the CPU of your machine
There's two companies in this world who are making most of the CPUs these days
One of them
Is AMD
And the other one is Intel
If you running a Mac
You got an Intel CPU
If you running a PC
You might either have an Intel CPU
Or you might have one made by AMD
Now the important thing is to figure out which one you've got
On Windows
Go to your control panel
And then click on system
And here
Under processor
You can bring up
Whether you've got an Intel
CPU
Or
An AMD
How to factor
CPU
Take out a piece of paper or bring up Notepad
And make a note of this write this down because this is quite important and will determine what kind of emulator
You going to be setting up
For those of you who have
Intel CPUs have an Intel processor
You're going to be lucky because
You get the chance to have
Hardware acceleration
So your emulator will run a lot faster
Now chances are when you initially installed Android Studio
You will up already installed
The Intel haxm
The hardware accelerated execution manager
Now in case it hasn't been installed let me show you how you can
Find this component and install it manually
The place you want to go
Is you want to go
To your SDK manager
Now you can either click on configure here on the splash screen
And select the SDK manager
Or you can go to preferences
And then under
Appearance and behavior system settings
Android SDK
Find your SDK manager here
Not supposed to already have Android Studio open
You can find the SDK manager
Other on this little shortcut here
Or under Tools
An Android
SDK manager
So these are some nice Shortcuts To Know
The bring you to the same place as going to your preferences or settings
So now that we've brought up the screen
Click on
SDK tools
And then here you should see
Intel
X86
Emulator accelerator
XM installer
As one of the line items
So if you want to download it you can just take this box
And then click apply
At which point
You'll get a dialogue
And
The installer
The wizard The android-studio brings up during the installation process
It's pretty straight
You just go with the recommended options
2 gigabytes for the emulator
Click next
And then the installation process is just clicking next
Through the wizard
So like I said earlier chances are that you've already gone through these steps when you first installed Android Studio
But in case you haven't or in Click case something screwed up
This is how you would
Find this component find is Hardware acceleration component
If you're running an Intel processor
And pulling it in manually and doing that setup
If you've got an AMD processor on the other hand
This Intel Hardware accelerator will not help you
And that's one of the reasons why we've made a note
What process are we have on our machines earlier
So I'm just going to click finish now
And we're done
Now you should be able to see an actual check back here
Next to the Intel emulator accelerator
And it says installed
Okay so now that we know what processor a computer has
And we've set up
Hardware acceleration
At least if you got an Intel processor
Now we can finally create our Android virtual device
So every virtual device need something called a system image
And we're going to download these system images
From our
SDK manager
So if I go back here to it where it says SDK platform
And then down here
I took this box where it says
Show package details
I can choose what system image
I want to download
Now again
Hear it matters what sort of processor you've got on your computer
If you have an Intel processor
I highly recommend
That you pick
The Intel x86
Item system image
So the one I've got kicked here is for API level 26
And it's the one which has the Google Play Store pre-installed on it
So this is the one that I recommend that you download
If you have an Intel processor
For those of you who have a computer with an AMD processor
You want to go
For an arm system image
Now you can see here at the time of recording for Android
Oreo 8.0 there actually is no arm system image available
So what you going to have to do
Is you going to have to take one maybe from Android nougat
Down here
Pick this one
Pick the arm
EAB iv7a system in
And this is for API level 25
The way you install any of the system images
Is pretty straightforward
You just take the box
And again you click apply
And then the wizard starts
Hasn't already got the Intel x86
System image installed
I'm just going to install the arm1 here just to show you what it looks like
I can we get this component installer dialogue
And a wizard
That we get to click through
But one thing I'll say is that the system images take up
Fairly decent amount of space on your hard disk
So you kind of want to pick and choose
What it is
That you're planning on installing right you don't need to install every single system image
How the other thing I'll mention is that you probably noticed
That there were other types of system images available
So for example
If you wanted to test an app on an Android Wear device
And you don't actually own one of these Android smart watches
The easiest way to do it is just to install the Android Wear
System image
For the API level that you're targeting
And then running your app on an Android emulator that is simulating
Dot smartwatch
So I hope you all have like a pretty decent internet connection
Otherwise
It takes ages for the downloads to happen for the unzipping to happen for the ins
Installation to happen
Make sure you got free space on your hard disk it's all I can say
Keep it above 10 to 15%
Otherwise
The computer is really going to struggle
Alright so
My installation is finished someone is going to click finish
Internet checkbox app is here
So
I've got my system images installed that I need for my emulators
So now we're done with the SDK manager I'm just me click okay
And we're back in our
Not a great the actual emulator
What can I use Android Studios virtual device manager
And there is a needle shortcut right here for the so-called avd manager
But we can also find it under Tools
Android
Avd manager
So you can see here that I've already set up some emulators of my own so I got 3 different emulators
That I've set up but the list you're looking at is probably blank right now
So what you want to do with you
Click down here with says create virtual device
And here
This is the wizard
That we're going to use
For creating a brand new emulator from scratch
Alpha category
We don't want to use TV we're or tablet we're going to go with phone
And
On the phones
We have a choice of pretty much all the Google devices
As well as some generic ones
On the list here
Right so there's some Hardware profiles that are ready
Pre-loaded with Android Studio
And the ones that I recommend other ones that have this little Play Store
Symbol next to them right Services the 5x and the five
So I recommend using the 5X
That way
Your emulator is going to look pretty similar to what I'm using in my videos
Once you've made your choice
Just click next here
And
This is where the system images come up that we've downloaded earlier
So you can see here that for this emulator
We have
A choice of recommended system images
And
I've got the Oreo
API level 26
X86 one with the Google Play Store
Recommended him for me
And that's because I downloaded earlier
And you can download the system images
If you're missing one or you want a different one
You can just go to x86 system images
And download the system image that you need
Dino
These are
Intel system images write x86
That sucks
For Intel processors
Now if you are on AMD
You'll want to use an AR M system image
And this is under other system image
So hear your seat the arm system images
A couple of minutes ago I downloaded that
Nougat API level 25
System image and you can see it hit in
Black right as opposed to gray which I have not downloaded and installed
So if you've got an AMD processor on your laptop
Pick this one
But if you got an Intel processor
On your laptop
Then
By all means
Pick the x86
Oreo system image
That's under the recommended list
Or if you haven't downloaded it yet
Get it here
Right
Okay so for this emulator
I'm going to pick the Oreo
X86
API
26
Google places
Next
Number to Eva's emulator a name
I'm going to call it
New Nexus 5x API 26
Emulator
I'm going to leave the start of orientation and all the advanced settings
At their default
If you're interested
You can take a look at these
But chances are you won't have to change the
Just click
Finish
And Wallah
Are
New emulator
Brand new is right here in the list
So now all we have to do is figure out if it works right
And we can do that right over here in the action section
And I wanted to delete an emulator
I can just
Click on the down arrow
Select Elite
But if I wanted to boot it up lunch
Then display symbol is my
So I'm going to click that
And now you can see for yourself
Just how long it takes
To start an emulator
Emulator performance has been one of the biggest frustrations of
Android development
It's been a huge pain in the neck from the beginning
And there has been a lot of effort from the
Tool Steam
From the Android tool Steam
To create better and faster emulators
But
It's still one of those things pet is just
Much much lower than the iPhone simulator
The thing that I'll say is that the CRM based emulator
That are running without Hardware acceleration
Are much much slower
So
Point
You really have to ask yourself
Is it worth running this on an emulator in the first place
I might as well just plug in a physical Android phone or get it
Kindle Fire on Black Friday or what have you
2
Pretest testes apps out because using those ERM Bay stimulators is just
Such a pain in the neck
Now there's actually one of the thing that's worth mentioning were thinking about
So
If you're running an older machine if you've got a laptop that's a couple of years old
Maybe it wasn't the fastest model
Then
You really have to think about whether an emulator is
Kenilworth running right
If you have an Android phone
Then
Going to be saving your computer a lot of resources
If you run the apps on that instead
If you're putting up an emulator and you're running.
Does take
White a lot of resources
To run and your computer
Will actually slow down
Significantly
If you have that emulator running
So I was recommend people to actually run it on a physical device
If they can
If you click on the lock hat
You can actually see that
It is listed here
As a device that's connected to Android Studio
Now there's no app running at the moment
So there's
Nothing here for typical processes
And she's got all these logs
Scrolling like crazy right
Kind of showing you what's happening on the device even though we're not even interacting with it
And this is this is also what
You'll see if you plug in a physical device you have all these logs scrolling
From all the activity on the app
Now before we wrap up this video I want to leave you with one final thought
So there are alternatives
To the standard Android emulator out there
And the most well-known and widely used one it's called Genie motion
So they're on Genie motion.com and they have a free version of their emulator
Prank butt
Just be aware all the advanced features
Are locked behind a paywall
And you also have to do a little bit of setup that requires the installation of the Oracle VM virtualbox
Right
So
You can give genymotion a try
You might find that it's
Slightly faster than the emulator that's an Android Studio
But again it's something that requires a bit of setup
And is it commercial Prada
So check it out if you're interested
But personally I found that the standard android-emulator was good enough for me