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