1
00:00:04,350 --> 00:00:09,120
alright in this video what we're going to
do is set up the Android SDK to run from

2
00:00:09,120 --> 00:00:13,950
the command line now this is actually
for mac users so if you're running on a

3
00:00:13,950 --> 00:00:17,670
Mac do watch this video as we go through
when and show you how to set up the path

4
00:00:17,670 --> 00:00:23,400
but for Windows users the previous video
was for you and linux users don't bother

5
00:00:23,400 --> 00:00:27,270
with this video but go to the next one
and other reason you want to do that is the

6
00:00:27,270 --> 00:00:30,780
commands are slightly different
depending on the operating system so if

7
00:00:30,780 --> 00:00:33,090
you're on a Mac you're in the right
place let's continue

8
00:00:33,090 --> 00:00:37,440
alright so I'm going to digress slightly
and set up the computer to access things

9
00:00:37,440 --> 00:00:41,850
like this sql lite command-line
interface so that you can enter sql

10
00:00:41,850 --> 00:00:46,010
lite commands on your computer now this
will also allow us to use the Android

11
00:00:46,010 --> 00:00:50,760
debug bridge or adb and we'll be using
that later in the course now you may

12
00:00:50,760 --> 00:00:54,870
have noticed that when you run your apps
from android studio you sometimes see a

13
00:00:54,870 --> 00:00:59,990
brief message pop up saying waiting for
adb now this comes up as a android

14
00:00:59,990 --> 00:01:04,640
studio starts the adb server on your
machine and checks that there's a

15
00:01:04,640 --> 00:01:09,960
physical device or emulator that it can
connect to now the android debug bridge

16
00:01:09,960 --> 00:01:15,530
is extremely useful that's what ADB is
for managing android devices and is the

17
00:01:15,530 --> 00:01:19,710
way that Android studio and installs and
runs your apps now because android

18
00:01:19,710 --> 00:01:24,680
studio knows where the Android SDK
installed on your machine it can use

19
00:01:24,680 --> 00:01:29,070
tools like the sql lite command-line
interface and the Android

20
00:01:29,070 --> 00:01:33,630
debug bridge adb with no problems but
for us to access them directly

21
00:01:33,630 --> 00:01:38,070
we have to actually add the Android SDKs
platform tools directory to our

22
00:01:38,070 --> 00:01:42,680
computers path so this video is going to
show you how to do that so

23
00:01:42,680 --> 00:01:46,950
the first step that we need to do is to
see if the paths already set up i've

24
00:01:46,950 --> 00:01:50,990
got android studio started as you can
see on the screen here now and you can

25
00:01:50,990 --> 00:01:55,380
either open a project that we worked on
previously and if you go in to do that

26
00:01:55,380 --> 00:01:58,460
open the project and click on file and
select project structure

27
00:01:59,030 --> 00:02:02,990
alternatively if you're on the welcome
screen as i am an Android studio just

28
00:02:02,990 --> 00:02:06,450
come in here click on configure and
click on sdk manager

29
00:02:06,450 --> 00:02:10,850
either way should get you to the same screen
and what we're looking for is android

30
00:02:10,850 --> 00:02:16,260
sdk location and you may see that if you
click on file project structure you need

31
00:02:16,260 --> 00:02:18,030
to click on sdk location

32
00:02:18,030 --> 00:02:23,430
to see the screen the bottom line here
that this is where the Android SDK has

33
00:02:23,430 --> 00:02:28,290
been installed by Android studio so we
need to actually take a copy that and

34
00:02:28,290 --> 00:02:31,980
copy it to your clipboard and then we are
going to be pasting it and modify

35
00:02:31,980 --> 00:02:34,050
that so I'm just going to come here and
click on it

36
00:02:34,050 --> 00:02:38,730
select it right click now if right click
doesn't work here so do a command C

37
00:02:38,730 --> 00:02:45,120
to copy and then I'm just going to open text edit just going to type text

38
00:02:45,120 --> 00:02:50,580
edit go to applications if you want
to and do it that way

39
00:02:50,580 --> 00:02:54,630
click on new document we're just going
to paste in that path and you can see

40
00:02:54,630 --> 00:03:00,630
its users timbuchalka library android
sdk with forward slashes now almost

41
00:03:00,630 --> 00:03:03,840
certainly your location is going to be
completely different to mine and that's

42
00:03:03,840 --> 00:03:08,550
ok if you copied it from Android studio
like I did it will be the correct path

43
00:03:08,550 --> 00:03:11,730
to whatever the android studio is
installed on your computer

44
00:03:12,930 --> 00:03:18,260
now adb and the sql lite both live in
a folder called platform-tools

45
00:03:18,260 --> 00:03:23,100
within the sdk folder so we need to add
a slash platform-tools to the end

46
00:03:23,100 --> 00:03:28,040
of this path that I have paste it into text edit
i'm going to click on to the end

47
00:03:28,040 --> 00:03:34,700
/ and i'm going to type platform making
sure I type in lowercase dash tools no

48
00:03:34,700 --> 00:03:38,760
extra spaces at the start or at the end
it's important that they're the same and

49
00:03:38,760 --> 00:03:41,820
once I've done that i'm going to select
whole path again i'm going to do another

50
00:03:41,820 --> 00:03:43,320
copy

51
00:03:43,320 --> 00:03:46,170
I've done a command c which you can
either right click and select copy

52
00:03:46,170 --> 00:03:52,350
if your prefer so we now got that in the
clipboard and what we need to do is go

53
00:03:52,350 --> 00:03:56,430
and open the terminal window to make
this change so the quickest way to do

54
00:03:56,430 --> 00:04:01,980
that is just to click on the little
magnifying glass over here and type in

55
00:04:01,980 --> 00:04:06,290
terminal and I could have actually just a
command space as well either will bring

56
00:04:06,290 --> 00:04:09,780
up this screen and type terminal that will
open up this little window you can see

57
00:04:09,780 --> 00:04:15,750
here and just zoom a little bit better
so a little bit now so you can see a

58
00:04:15,750 --> 00:04:22,410
little bit better and the commands you want
to type now are touch...

59
00:04:22,410 --> 00:04:27,750
....

60
00:04:27,750 --> 00:04:31,740
....making sure
you've got exactly

61
00:04:31,740 --> 00:04:37,110
the same capitalization that you see
here basically all lower case we're

62
00:04:37,110 --> 00:04:43,440
going to type...

63
00:04:43,440 --> 00:04:46,940
and should fill in the rest of us
automatically I can press tab again or type

64
00:04:46,940 --> 00:04:51,840
pr and press tab gives us the full
names we can open that file now press

65
00:04:51,840 --> 00:04:58,190
enter there may or may not be contents
already in here so if there is you want

66
00:04:58,190 --> 00:05:02,490
to go down into the last line but in the
case of my file it's actually empty so

67
00:05:02,490 --> 00:05:07,620
what I'm going to do is I'm going to
type in export....

68
00:05:07,620 --> 00:05:13,280
....

69
00:05:13,280 --> 00:05:18,210
....then we need to
paste in the Android SDK path that we

70
00:05:18,210 --> 00:05:22,340
copied into the clipboard earlier i'm
going to paste that in there now then

71
00:05:22,340 --> 00:05:25,190
put a double quote in there and other
thing was you notice i put a colon

72
00:05:25,190 --> 00:05:29,720
not semicolon but a colon after the word path
and before the path that I pasted

73
00:05:29,720 --> 00:05:34,560
in and you can see we've got a double
quote around both of them as well alright

74
00:05:34,560 --> 00:05:38,000
so we can actually save that now so i'm
going to click on file and select save

75
00:05:38,000 --> 00:05:43,460
and normally you have to log out for the
changes to take effect but there is

76
00:05:43,460 --> 00:05:47,460
another command we can use which will
actually get the system to read

77
00:05:47,460 --> 00:05:51,300
those changes that we've just added to
that file as we can come back here back

78
00:05:51,300 --> 00:05:57,630
to our terminal we can type in source....

79
00:05:57,630 --> 00:06:01,310
....will be enough and press tab and
give us the rest of the name press enter

80
00:06:01,310 --> 00:06:05,900
and if you haven't got any input back
that normally means that things have

81
00:06:05,900 --> 00:06:09,500
worked and it's been updated for us
automatically if you get some sort of error

82
00:06:09,500 --> 00:06:12,900
make sure you go back and check that
you've typed in exactly as you seen me type it

83
00:06:12,900 --> 00:06:16,190
in here in my case it seems to have
worked

84
00:06:16,190 --> 00:06:19,440
we haven't got any errors so there's two
things we can do here we can just type

85
00:06:19,440 --> 00:06:25,020
in adb lowercase press ENTER and we're
getting an error there so I'm just going

86
00:06:25,020 --> 00:06:29,430
to see what I've done here going to
type in sql lite 3 and whether

87
00:06:29,430 --> 00:06:35,610
works and sql lite three is working
i'm not too sure why adb's isn't working

88
00:06:35,610 --> 00:06:41,150
but the main one that we wanted to get
working here was that sql lite so that's

89
00:06:41,150 --> 00:06:44,430
great that's actually working let me
just go back and see what's going on

90
00:06:44,430 --> 00:06:45,210
again

91
00:06:45,210 --> 00:06:50,610
going to type .quit and I think what
probably happened here is I've set up a

92
00:06:50,610 --> 00:06:55,340
virtual machine for this copy of osx
because i wanted to show you what it

93
00:06:55,340 --> 00:07:00,000
would be like setting up a path without
having set up previously in my

94
00:07:00,000 --> 00:07:03,410
development machine it has been set up so i
think i haven't actually install all the

95
00:07:03,410 --> 00:07:07,560
tools developer tools correctly
the bottom line here is that you should

96
00:07:07,560 --> 00:07:11,460
find that when you talk in ADB you'll
find that it does work and in any event

97
00:07:11,460 --> 00:07:14,690
the main thing was that in this
particular section of the course we're

98
00:07:14,690 --> 00:07:17,630
looking for the sql lite 3 and
that definitely worked as you can see

99
00:07:17,630 --> 00:07:22,020
their so consequently i'm happy to say
that this is working and you'll find

100
00:07:22,020 --> 00:07:25,380
that this should work for you when you
actually do the similar thing and you

101
00:07:25,380 --> 00:07:29,130
probably won't get this error with the
ADB and that's because you've downloaded

102
00:07:29,130 --> 00:07:32,190
and installed the android software
development kit correctly which i

103
00:07:32,190 --> 00:07:36,030
haven't completely done here alright so
that's basically what we need to do at

104
00:07:36,030 --> 00:07:40,340
this point we've confirmed that we've
got the sql lite 3 in our path

105
00:07:40,340 --> 00:07:43,710
and that means that in future videos in
this section we're going to be able to

106
00:07:43,710 --> 00:07:48,900
use this to start manipulating databases
creating databases and adding columns

107
00:07:48,900 --> 00:07:53,370
and rows etc so let's start working
on that in the video after the next one

108
00:07:53,370 --> 00:07:57,530
because the next video which is one you
want to skip now relates to getting

109
00:07:57,530 --> 00:08:01,190
this set up on a linux machine so skip
that video and move on to the video

110
00:08:01,190 --> 00:08:05,070
sql lite

