Welcome back.
And this video, we are going to set up the app, which stands for Android Virtual Device, which basically
is an emulator that emulates Android on our PC.
This then allows us to test our applications directly on the PC without having to connect our phone
to it.
Or maybe you don't even have an Android phone, so you couldn't even test it.
So let's go ahead and set up an app and you can see here at the top it says no devices.
That's because I have no Android virtual device setup.
So let's go to the AVD manager.
You can find it either this way or you can also find it here on the top right hand corner or, well,
even other tools.
You can find the Aberdeen manager so many different ways of finding this Android virtual device manager.
So here you can set up your Android virtual device.
So let's go ahead and create one.
And you can then choose between different categories.
So if you want to create a virtual device for TV or for the watch or tablet or automotive, you can
change the category here.
You will find more details here on the right hand side, and you can then select between different options.
So what I'm going to do is I will use a Pixel four that uses the Play Store so you can see this little
icon here.
Let's select this game.
You can, of course, also select Pixel five.
But the problem will be that it will not have the Play Store installed on it.
So the beauty would be then that you can also install Play Store applications, but at the same time
use Play Store extensions, which we will do at a later point in the course.
But you can, of course, then delete emulator and just create a new one that's really very easily done.
OK, so then click next.
And here you need to select the system image, which basically just means the Android Studio version.
Now, let me make the screen a little bigger so you can see everything a little better, so you can
see that you can download the different versions.
And the one that is allowed to me at this point would be Android 11, which would be the latest version.
But I instead want to use Android 12 version because I want to be able to run it even on Android 12
and just test if it works on new devices very well.
So I'm going to go to X eighty six images here.
That's because I run an Intel PC.
In your case, you will then have to go through other images and then select an arm based emulator.
So it really depends on what you are using if you have an arm based PC.
I would recommend to go to other images and then download the S version.
So Android SE with API Level 31 with Android 12.
In my case, I'm going to do the same for the S x64, including Google apps.
You can also select the one with Google Play, but the Google APIs, in my case, will be good enough
for now.
If I ever need to change that, I will just download this and then just install the new Android version.
So just to show you this is how it's going to look like.
So the component installer will pop up, and it will download the latest Android version, which is
another 1.3 gigabytes storage, which I don't want to use now.
OK, so let's go to next and now we can give it a name.
So it says Pixel four API 31, I'm going to call this one Android 12 as well.
Now you can still change it from here.
You can still change the version if you want to.
Then the start up orientation will be portrait.
In my case, I don't want to start in the landscape.
And you can also show some advanced settings.
Once you click on this button here and then you can change things such as what the back and front camera
should be like.
So I'm just going to say that it should emulate the front camera, but you can also use a webcam that
you have installed on your PC in order to then use the actual camera of your PC for the Android virtual
device.
The network speed is something you can set up, so if you wanted to simulate a certain speed, let's
say you want to test.
If your application runs on 3G, you could change that to UMTS or HSDPA.
So that's something that you can do from here, but you can also change to later on, as well as some
latency and so forth.
So I'm going to select a quick boot, which will make the booting process a little faster.
I'm going to say that it should use four of my course now.
You can change that depending on how many course you have, in my case, F10 course.
So I'm just going to say that my Android virtual device should use four of those cores.
You can also change how much ram your device should have.
I'm just going to say it has thousand five hundred thirty six megabytes of RAM, a little bit of hip
and 800 megabytes of storage, and you can change that as well if you need some more storage for your
device.
In our case, we're going to create very small applications in terms of their size, so they will have
certain functionality.
Which might be extensive, but but the programs itself will not be very big.
OK, so that would be pretty much it.
So that's a big finish.
And then you can find this Android virtual devices overview here.
So you have one device at this point.
You can see it requires 530 megabytes on the disk, but once we started up, it will require multiple
gigabytes.
Now you can edit it.
If you want to make changes to it, you can wipe the data if you have any issues with it, or you can
even delete it and create the new one.
And you can even have multiple virtual devices at once.
So if you want to test it on different devices just to see how it's going to look like on different
device sizes and screen sizes, you can create multiple emulators at a time.
But I would always recommend to just have one emulator running at once because otherwise?
Well, it will require a bunch of RAM and CPU power on your PC.
So now let's close this Android virtual device manager and you can now see here at the top we have the
Pixel four API 31 Android 12 device selected, and we can now press this one app button.
Let's do that.
To see if our emulator will pop up and even start our little application now, in my case, I have installed
some anti-cheat software for some video games, and that's what pops up here.
So I'm just going to get rid of that.
And it also even says that my antivirus program might impact the built performance, which means the
performance at which an application is being built and run on a testing device.
OK, so there we are.
This is my first app, and you can see it's basically this hello world that we have here.
So before we change that hello world application, which we are going to do in the next video, we can
see that our app in general works on this virtual device.
And by the way, this is an actual Android phone, so to speak on your PC.
So you can just press the home button and you come back to the homescreen and you can swipe up and you
will find all of the apps that are installed on this device by default.
So my first app, by the way, is also installed on this app.
So it's on this device.
So it's click on it and you can see my first app pops up saying, Hello world.
OK, so that's pretty much it.
Before we go to the next video where we're going to create our first Helloworld application, let's
quickly look at the settings.
So if you click on this dot dot dot here, you can change the settings.
So, for example, you can fake a different location.
Currently, the location is set to Mountain View Palo Alto, probably there where the Google head offices
are, but you can make some more changes to your device, for example, here on the cellular.
You can change the network type two, 4G, 3G, 2G and so forth.
You can change the battery settings so you can see now it's at 100 percent.
So let's go down to, for example, 50 percent you can see here.
There it changes based on our settings.
So these are little things that you can change also.
Now I'm charging, so you can see the HTC Charger setting is set up.
So there's this little lightning icon there and the camera.
So if you want to use a specific camera, you can set that up here as well.
So these were just some things that you can set up.
You can, of course, go through all of the settings here to familiarize yourself with it, by the way,
if you want to make your phone louder.
You can do that with those buttons here.
If you want to tilt your device or turn it, you can use those buttons here.
OK, so that's it for this video.
See, in the next one where we're going to set up Helloworld.