1 00:00:00,240 --> 00:00:00,900 Welcome back. 2 00:00:01,110 --> 00:00:06,930 And this video, we are going to set up the app, which stands for Android Virtual Device, which basically 3 00:00:06,930 --> 00:00:10,950 is an emulator that emulates Android on our PC. 4 00:00:11,130 --> 00:00:16,560 This then allows us to test our applications directly on the PC without having to connect our phone 5 00:00:16,560 --> 00:00:16,920 to it. 6 00:00:16,920 --> 00:00:20,310 Or maybe you don't even have an Android phone, so you couldn't even test it. 7 00:00:20,790 --> 00:00:25,820 So let's go ahead and set up an app and you can see here at the top it says no devices. 8 00:00:25,890 --> 00:00:28,620 That's because I have no Android virtual device setup. 9 00:00:28,920 --> 00:00:30,950 So let's go to the AVD manager. 10 00:00:30,960 --> 00:00:36,570 You can find it either this way or you can also find it here on the top right hand corner or, well, 11 00:00:36,570 --> 00:00:37,590 even other tools. 12 00:00:37,590 --> 00:00:42,840 You can find the Aberdeen manager so many different ways of finding this Android virtual device manager. 13 00:00:43,140 --> 00:00:45,970 So here you can set up your Android virtual device. 14 00:00:45,990 --> 00:00:47,520 So let's go ahead and create one. 15 00:00:47,850 --> 00:00:51,060 And you can then choose between different categories. 16 00:00:51,330 --> 00:00:58,170 So if you want to create a virtual device for TV or for the watch or tablet or automotive, you can 17 00:00:58,650 --> 00:01:00,510 change the category here. 18 00:01:00,510 --> 00:01:05,580 You will find more details here on the right hand side, and you can then select between different options. 19 00:01:06,060 --> 00:01:12,750 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 20 00:01:12,750 --> 00:01:13,590 icon here. 21 00:01:14,160 --> 00:01:15,930 Let's select this game. 22 00:01:16,320 --> 00:01:18,660 You can, of course, also select Pixel five. 23 00:01:18,900 --> 00:01:22,650 But the problem will be that it will not have the Play Store installed on it. 24 00:01:22,650 --> 00:01:28,110 So the beauty would be then that you can also install Play Store applications, but at the same time 25 00:01:28,140 --> 00:01:33,600 use Play Store extensions, which we will do at a later point in the course. 26 00:01:33,600 --> 00:01:39,240 But you can, of course, then delete emulator and just create a new one that's really very easily done. 27 00:01:39,960 --> 00:01:41,240 OK, so then click next. 28 00:01:41,550 --> 00:01:48,360 And here you need to select the system image, which basically just means the Android Studio version. 29 00:01:48,750 --> 00:01:53,970 Now, let me make the screen a little bigger so you can see everything a little better, so you can 30 00:01:53,970 --> 00:01:56,460 see that you can download the different versions. 31 00:01:56,760 --> 00:02:03,330 And the one that is allowed to me at this point would be Android 11, which would be the latest version. 32 00:02:03,720 --> 00:02:10,169 But I instead want to use Android 12 version because I want to be able to run it even on Android 12 33 00:02:10,169 --> 00:02:12,570 and just test if it works on new devices very well. 34 00:02:13,140 --> 00:02:16,360 So I'm going to go to X eighty six images here. 35 00:02:16,380 --> 00:02:18,570 That's because I run an Intel PC. 36 00:02:18,900 --> 00:02:25,530 In your case, you will then have to go through other images and then select an arm based emulator. 37 00:02:25,950 --> 00:02:29,640 So it really depends on what you are using if you have an arm based PC. 38 00:02:29,670 --> 00:02:35,010 I would recommend to go to other images and then download the S version. 39 00:02:35,010 --> 00:02:38,790 So Android SE with API Level 31 with Android 12. 40 00:02:39,330 --> 00:02:46,870 In my case, I'm going to do the same for the S x64, including Google apps. 41 00:02:46,980 --> 00:02:52,110 You can also select the one with Google Play, but the Google APIs, in my case, will be good enough 42 00:02:52,110 --> 00:02:52,530 for now. 43 00:02:52,980 --> 00:03:00,060 If I ever need to change that, I will just download this and then just install the new Android version. 44 00:03:00,210 --> 00:03:02,740 So just to show you this is how it's going to look like. 45 00:03:02,760 --> 00:03:10,170 So the component installer will pop up, and it will download the latest Android version, which is 46 00:03:10,440 --> 00:03:15,150 another 1.3 gigabytes storage, which I don't want to use now. 47 00:03:15,780 --> 00:03:19,200 OK, so let's go to next and now we can give it a name. 48 00:03:19,470 --> 00:03:24,870 So it says Pixel four API 31, I'm going to call this one Android 12 as well. 49 00:03:25,530 --> 00:03:27,900 Now you can still change it from here. 50 00:03:27,960 --> 00:03:30,060 You can still change the version if you want to. 51 00:03:30,420 --> 00:03:32,700 Then the start up orientation will be portrait. 52 00:03:32,700 --> 00:03:35,040 In my case, I don't want to start in the landscape. 53 00:03:35,490 --> 00:03:38,130 And you can also show some advanced settings. 54 00:03:38,250 --> 00:03:44,550 Once you click on this button here and then you can change things such as what the back and front camera 55 00:03:44,550 --> 00:03:45,390 should be like. 56 00:03:45,480 --> 00:03:52,050 So I'm just going to say that it should emulate the front camera, but you can also use a webcam that 57 00:03:52,050 --> 00:03:58,170 you have installed on your PC in order to then use the actual camera of your PC for the Android virtual 58 00:03:58,170 --> 00:03:58,560 device. 59 00:03:59,040 --> 00:04:04,290 The network speed is something you can set up, so if you wanted to simulate a certain speed, let's 60 00:04:04,290 --> 00:04:05,190 say you want to test. 61 00:04:05,190 --> 00:04:11,160 If your application runs on 3G, you could change that to UMTS or HSDPA. 62 00:04:12,030 --> 00:04:17,100 So that's something that you can do from here, but you can also change to later on, as well as some 63 00:04:17,100 --> 00:04:19,170 latency and so forth. 64 00:04:20,040 --> 00:04:25,020 So I'm going to select a quick boot, which will make the booting process a little faster. 65 00:04:25,590 --> 00:04:29,310 I'm going to say that it should use four of my course now. 66 00:04:29,310 --> 00:04:32,700 You can change that depending on how many course you have, in my case, F10 course. 67 00:04:33,060 --> 00:04:37,530 So I'm just going to say that my Android virtual device should use four of those cores. 68 00:04:37,830 --> 00:04:40,830 You can also change how much ram your device should have. 69 00:04:40,860 --> 00:04:46,200 I'm just going to say it has thousand five hundred thirty six megabytes of RAM, a little bit of hip 70 00:04:46,350 --> 00:04:51,780 and 800 megabytes of storage, and you can change that as well if you need some more storage for your 71 00:04:52,620 --> 00:04:53,040 device. 72 00:04:53,310 --> 00:04:59,130 In our case, we're going to create very small applications in terms of their size, so they will have 73 00:04:59,130 --> 00:04:59,930 certain functionality. 74 00:05:00,090 --> 00:05:03,690 Which might be extensive, but but the programs itself will not be very big. 75 00:05:04,470 --> 00:05:06,600 OK, so that would be pretty much it. 76 00:05:06,810 --> 00:05:07,590 So that's a big finish. 77 00:05:07,590 --> 00:05:11,550 And then you can find this Android virtual devices overview here. 78 00:05:11,640 --> 00:05:14,430 So you have one device at this point. 79 00:05:14,730 --> 00:05:20,250 You can see it requires 530 megabytes on the disk, but once we started up, it will require multiple 80 00:05:20,250 --> 00:05:20,880 gigabytes. 81 00:05:21,780 --> 00:05:23,880 Now you can edit it. 82 00:05:23,940 --> 00:05:28,290 If you want to make changes to it, you can wipe the data if you have any issues with it, or you can 83 00:05:28,290 --> 00:05:29,910 even delete it and create the new one. 84 00:05:30,150 --> 00:05:32,950 And you can even have multiple virtual devices at once. 85 00:05:32,950 --> 00:05:38,040 So if you want to test it on different devices just to see how it's going to look like on different 86 00:05:38,040 --> 00:05:42,660 device sizes and screen sizes, you can create multiple emulators at a time. 87 00:05:43,020 --> 00:05:47,850 But I would always recommend to just have one emulator running at once because otherwise? 88 00:05:48,270 --> 00:05:53,100 Well, it will require a bunch of RAM and CPU power on your PC. 89 00:05:53,640 --> 00:05:58,740 So now let's close this Android virtual device manager and you can now see here at the top we have the 90 00:05:58,740 --> 00:06:05,670 Pixel four API 31 Android 12 device selected, and we can now press this one app button. 91 00:06:05,770 --> 00:06:06,840 Let's do that. 92 00:06:07,200 --> 00:06:13,860 To see if our emulator will pop up and even start our little application now, in my case, I have installed 93 00:06:13,860 --> 00:06:19,020 some anti-cheat software for some video games, and that's what pops up here. 94 00:06:19,110 --> 00:06:21,150 So I'm just going to get rid of that. 95 00:06:21,570 --> 00:06:27,630 And it also even says that my antivirus program might impact the built performance, which means the 96 00:06:27,630 --> 00:06:34,680 performance at which an application is being built and run on a testing device. 97 00:06:37,110 --> 00:06:38,430 OK, so there we are. 98 00:06:38,910 --> 00:06:43,170 This is my first app, and you can see it's basically this hello world that we have here. 99 00:06:43,980 --> 00:06:50,130 So before we change that hello world application, which we are going to do in the next video, we can 100 00:06:50,130 --> 00:06:53,340 see that our app in general works on this virtual device. 101 00:06:53,340 --> 00:06:57,830 And by the way, this is an actual Android phone, so to speak on your PC. 102 00:06:58,110 --> 00:07:04,650 So you can just press the home button and you come back to the homescreen and you can swipe up and you 103 00:07:04,650 --> 00:07:08,790 will find all of the apps that are installed on this device by default. 104 00:07:09,120 --> 00:07:12,840 So my first app, by the way, is also installed on this app. 105 00:07:12,840 --> 00:07:14,200 So it's on this device. 106 00:07:14,200 --> 00:07:18,150 So it's click on it and you can see my first app pops up saying, Hello world. 107 00:07:19,020 --> 00:07:20,880 OK, so that's pretty much it. 108 00:07:21,180 --> 00:07:25,770 Before we go to the next video where we're going to create our first Helloworld application, let's 109 00:07:25,770 --> 00:07:27,150 quickly look at the settings. 110 00:07:27,240 --> 00:07:32,040 So if you click on this dot dot dot here, you can change the settings. 111 00:07:32,040 --> 00:07:34,610 So, for example, you can fake a different location. 112 00:07:34,620 --> 00:07:41,760 Currently, the location is set to Mountain View Palo Alto, probably there where the Google head offices 113 00:07:41,760 --> 00:07:46,910 are, but you can make some more changes to your device, for example, here on the cellular. 114 00:07:46,950 --> 00:07:52,950 You can change the network type two, 4G, 3G, 2G and so forth. 115 00:07:53,580 --> 00:07:56,610 You can change the battery settings so you can see now it's at 100 percent. 116 00:07:56,610 --> 00:08:00,870 So let's go down to, for example, 50 percent you can see here. 117 00:08:01,560 --> 00:08:04,870 There it changes based on our settings. 118 00:08:05,250 --> 00:08:08,220 So these are little things that you can change also. 119 00:08:09,060 --> 00:08:12,990 Now I'm charging, so you can see the HTC Charger setting is set up. 120 00:08:13,040 --> 00:08:17,370 So there's this little lightning icon there and the camera. 121 00:08:17,370 --> 00:08:22,140 So if you want to use a specific camera, you can set that up here as well. 122 00:08:22,620 --> 00:08:25,230 So these were just some things that you can set up. 123 00:08:25,230 --> 00:08:29,970 You can, of course, go through all of the settings here to familiarize yourself with it, by the way, 124 00:08:29,970 --> 00:08:33,270 if you want to make your phone louder. 125 00:08:33,360 --> 00:08:35,220 You can do that with those buttons here. 126 00:08:35,549 --> 00:08:39,450 If you want to tilt your device or turn it, you can use those buttons here. 127 00:08:40,020 --> 00:08:41,890 OK, so that's it for this video. 128 00:08:41,940 --> 00:08:44,280 See, in the next one where we're going to set up Helloworld.