In this video I'm going to show you how to download and install Android Studio, 2
which is the program we're going to be using to write our Android applications 3
in this course. So this is a video for the Linux platform, so if you're running 4
Windows or a Mac, there's a separate video in this section you can follow along 5
with and watch for those operating systems. But if you're using Linux you're 6
in the right place. Now it's possible that you might be running a 32-bit 7
version of Linux. If that's the case, I'd seriously suggest you consider 8
installing a 64-bit version, the next time you rebuild your computer. 9
Now a check is quite easy. You just open a terminal, 10
and we just type uname space 11
- m, and that'll tell you whether you're running a 64 or a 32 bit version. 12
You can see in my case it's reporting x86_64, so that's clearly me 13
running a 64 bit version, but if you see i 386 or i 686, that means you're 14
running a 32-bit version of Linux. Android Studio now includes its own 15
installation of Java, but only ships with a 64 bit version and that won't work on 16
a 32 bit Linux system. In June 2019, Google announced that they're dropping 17
support, actually, for 32-bit systems. The 32-bit version of Android Studio will be 18
deprecated - in other words, no longer available in December 2019 - and the 19
32-bit Android emulators, which you use to run Android apps on your computer, 20
well they're also deprecated in June 2019. So you can find an announcement about that, 21
I'll just close the terminal window for now. We'll open a new tab. I'll paste in 22
this link, which is available in the resources section of this video, 23
and this blog post from Google has got a lot more information about it. 24
So if you're using a 32-bit version of Linux, do consider updating to a 64-bit version. 25
You can always dual boot if you need a 32-bit version for some games. 26
Now distros like Ubuntu have now committed to keeping the 32-bit 27
libraries on their 64-bit versions, so most programs should continue to work on 28
a 64-bit version of Linux. So I can go ahead now and install Linux, sorry, 29
install Android Studio I should say, by doing a search for "install android studio", 30
and we want to go and visit the first website that's got developer.android.com in the URL, 31
which is this top one. Click on that, and basically, you want to make sure 32
that you are at developer.android.com so you're basically downloading from the 33
official source. I'm gonna click on download the latest version of Android Studio, 34
noting that for me, you see down the bottom there it says 3.5 for Linux 35
64-bit 729 megabytes. It's 3.5 as of the time I'm recording this video, the 36
latest version, but if you see a higher version and it is released, which it is 37
on the screen, then you're good to go. Now if you do go to download and you see 38
that it's a preview release, or a pre-release, make sure you don't use that 39
version. It's highly recommended to use the latest stable production release, 40
which in my case here, is on this page, 3.5 for Linux. Alright so if you're ready 41
now to do a fresh install of Android Studio 3.5, which I am on Linux, let's 42
begin. So I'm going to click on the download Android Studio button. 43
I'm going to agree to the terms and conditions, download it for Linux 44
and I'm going to save that. That's saving to my downloads folder because I'm in 45
Firefox. Now while that's downloading you might 46
want to go and just have a look at some information, and I'll just paste in 47
this link which is also available in the resources section on this video. 48
There's some basic installation instructions there for Linux as well, 49
and various flavors or distros of linux are actually supported there with the information. 50
Now this page mentions some required libraries you may need to install. 51
There's no date on this page that I can see, anyway, and we found that these 52
libraries don't seem to be needed for version 3.5 of Android Studio, because as 53
we're just seen, it's now fully 64-bit, but make a note of the link and come 54
back here to install those libraries if you get any problems with missing 32-bit libraries. 55
Now I'm installing on a fresh Ubuntu 18.04 LTS version, and I 56
know that that doesn't have any of these libraries installed and everything's worked fine, 57
and as we'll see in this video it should go through and install again now. 58
Right, looking at our downloads over here, we can see that that's now finished. 59
I'm going to click on that now. 60
That opens an archive manager, 61
and we close down the browser because we've pretty much 62
finished with that for now. And I'm going to click on extract and we need to choose 63
the location where I'm going to install this. So I'm going to do it in my home folder, 64
so I'm just going to select home up here, and click on extract. 65
Now you may want it to install it to slash USR slash local instead. If you're comfortable with 66
Linux file permissions, do whatever you'd normally do when installing software, but 67
if you're new to Linux, then extracting to your home folder will work fine. 68
You can see that that's finished. I'm going to close that down, and what we need to do now is 69
open another terminal session. I know I closed it earlier in the video. 70
Now a shortcut to opening a terminal session is ctrl alt T, so I'll do that 71
this time. We'll bring this over to the middle of 72
the screen. We want to change our directory into the folder we just 73
created, so cd~/ and it's going to be a for android and that 74
should find it for us, and there's our Android Studio folder, and if we do an ls there, 75
ls and have a look, we can see there's a bin folder. We're going to click on, or 76
select rather, third time lucky, go into that directory I should say. It's in the bin, 77
as you saw me do, and there's actually a file in there called studio.sh, which we 78
want to invoke. We going to do that by typing ./studio.sh 79
and that will invoke Android Studio. We can ignore that warning message 80
there, and you see we're getting prompted now to do an import. You can see it's 81
giving us the option to import settings from a previous installation. This can 82
save you having to change all your settings again, but as we're doing a 83
first time installation, I'm going to leave it on the default, which is Do not 84
import settings and just click on OK. 85
Once that pops up I'm going to click on Don't send to allow Google to collect 86
anonymous usage data. You can click on send if you prefer but I'm clicking on 87
Don't send. 88
We're now starting the Android, or have started the Android 89
Studio setup wizard, so I'm going to click on Next. Now I'm going to choose a 90
Standard setup here. You can customize Android Studio later if you want to. 91
Click on next. We've got a choice of themes. Android studio comes with two, 92
as you can see. The standard one's called light, and I'm going to leave it on that one 93
because it comes up good in the video, but you can choose darkula if 94
you prefer, which is better on the eyes and, generally, what I would recommend for 95
developers. Choose one of those, click on Next and then click on Next again, 96
because we've got some more downloading to do at this point. 97
Now on this screen, before the download starts, it's popped up if your computer supports hardware virtualization. 98
Now if you're using Ubuntu or a distro based on it, then you 99
should already have KVM installed. If you're not sure, click the link and 100
bookmark it, in case you need to review the instructions later. And also keep in 101
mind there's a video later in this section, on making sure that VTX is 102
enabled in your computer's bios, which may be an issue preventing you from 103
using the accelerated performance mode. Now we do need to have VTX enabled 104
because android emulators run as virtual machines, and we need KVM working, so this'll 105
make more sense later. For me, you can see that it has detected that, so I'm 106
just going to click on Finish at this point. 107
Android Studio is now downloading a lot of the tools that it needs, and this includes the Android SDK software 108
development kit, which is actually quite large. So it'll actually download about 109
1.5 gigabytes of related material files etc at this point, and if you do get a 110
dialog asking you to retry at some point, just click Retry. Sometimes the download 111
of some components fail for no apparent reason and retrying it would generally 112
fix it. Sometimes it does take more than one retry and I've got no idea why this 113
happens - busy network perhaps - but in any event, if 114
you do happen to see a Retry, just go ahead and do that. Alright, so I'm going 115
to speed up the video now while the components are actually downloaded here. 116
Well as you see, now that the components have all been downloaded, we've got a 117
summary screen here. It is worth scrolling up and down this if you 118
haven't been there while it's downloading, just to make sure there's no errors. 119
As you can see in my case, there's no errors showing and everything's up to date. 120
So I'm going to click on finish at this point, 121
and just size it up so we can see everything. I'm going to close down the, actually I'll need to 122
leave that running for now. Now that Android Studio's started it's a good idea 123
to set up a desktop launcher so you don't have to keep running Android 124
Studio from the terminal. To do that there's a built in option. Click on 125
Configure, and click on Create desktop entry down here. 126
You've got the option to create it for all users if you want, but I'm not going to do that and I'm just 127
going to do it for the current user. Click on OK. At this point we can now 128
exit Android Studio so I'm going to close that down. 129
I'm also now going to exit the terminal window, 130
and just to confirm that it's working, let's see if we can start the Android Studio, 131
you can see there's a desktop entry there. I'm just going to click on that now. We should see that 132
Android Studio will start for us. 133
And you can see that we're good to go and Android 134
Studio is working successfully on our Linux platform. 135
Alright, so that's Android Studio installed, and one other thing I want to do before we finish the 136
video, is just make sure that KVM is actually working on this system. 137
So I'll open up a terminal window again. 138
I'm going to type kvm ok, and you can see in 139
my system, because it's a brand new install it's not installed, so I'm gonna 140
type sudo apt install cpu checker, 141
and we'll install that and then we'll actually check to see if the hardware 142
virtualization is actually supported. We did see that earlier in the video, 143
but kvm-ok now should work, and we'll run this as root just to check it, 144
so sudo /usr/bin/kvm-ok. 145
Now my computer is showing at the moment 146
that it doesn't support KVM, and the reason for that is this is a virtual 147
machine - it's actually running on my Mac, actually, and I'm recording it that way. 148
So if you're installing this on a regular computer, you'd find that you'd 149
have no dramas and everything would work properly. That's a good way just to check 150
that you are running and if you find that there's any issues with you getting 151
KVM extensions working, refer back to that link that I talked about earlier in 152
the video, which hopefully you've bookmarked, and you can find out more 153
information on how to go about actually getting that working. 154
And just as another aside, if it's not working, search online to see if your processor in your 155
computer supports VTX, or AMDV for an AMD processor, then watch the later video to 156
enable it in your bios - that's the one that I talked about. In the past, virtualization 157
was always enabled for AMD processors. Recent motherboards may also need SVM to 158
be enabled, and that'll be in the security settings in your bios. 159
Alright, so I'm going to end the video here. In the next one we need to do some 160
configuration of Android Studio. The steps at this point on now are largely 161
the same, regardless of which operating system you're using, so I'll see you in 162
the next video which is titled Configure Android SDK for all three platforms. 163
See you in the next video.