1 00:00:03,940 --> 00:00:08,410 so in this video we're going to set up the android sdk for the terminal so that 2 00:00:08,410 --> 00:00:12,090 we can access the via command-line interface this is actually for linux 3 00:00:12,090 --> 00:00:17,280 users the last two videos prior to this one were for windows and mac users so if 4 00:00:17,280 --> 00:00:20,500 you're running one of those operating systems don't bother watching this video 5 00:00:20,500 --> 00:00:23,890 but instead go back and watch the appropriate video for your operating 6 00:00:23,890 --> 00:00:27,430 system that's because the instructions to get this to work are different for 7 00:00:27,430 --> 00:00:30,370 each operating system but if you're running linux you're in the right place 8 00:00:30,370 --> 00:00:34,090 and do watch this video as i go through now and show you how to set up 9 00:00:34,090 --> 00:00:38,350 the path now we're going to be talking about setting up the computer to access 10 00:00:38,350 --> 00:00:42,690 things like the sql lite command-line interface so that we can enter the 11 00:00:42,690 --> 00:00:47,850 sql lite commands on the computer or on your computer and this will also allow 12 00:00:47,850 --> 00:00:52,440 us to use the Android debug bridge or ADB and we'll be using that later in the 13 00:00:52,440 --> 00:00:56,400 course and just out of interest you may have noticed that when you run your apps 14 00:00:56,400 --> 00:01:00,870 from android studio you sometimes see a brief message saying waiting for ADB 15 00:01:00,870 --> 00:01:05,580 well that comes up as Android studio starts the ADB server on your machine 16 00:01:05,580 --> 00:01:09,880 and checks that there's a physical device or emulator that it can connect 17 00:01:09,880 --> 00:01:14,860 to now the ADB the Android debug bridge is extremely useful for managing 18 00:01:14,860 --> 00:01:18,910 android devices and is the way that Android studio installs and runs 19 00:01:18,910 --> 00:01:24,580 your apps now because android studio knows where the android sdk is installed 20 00:01:24,580 --> 00:01:27,730 on your machine because it actually install it when you were first installed 21 00:01:27,730 --> 00:01:31,720 android studio you can use tools like the sql lite command-line interface 22 00:01:31,720 --> 00:01:35,980 and aDb with no problems but for us to use them directly 23 00:01:36,520 --> 00:01:40,630 we have to actually add the Android SDKs platform tools directory to our 24 00:01:40,630 --> 00:01:45,850 computer paths manually so letes actually see how to do that so the first step we 25 00:01:45,850 --> 00:01:49,960 want to do is check to see if the paths already set up so i've got android 26 00:01:49,960 --> 00:01:53,980 studio opened and you can either be open on the welcome screen or you can open a 27 00:01:53,980 --> 00:01:58,000 project that perhaps you've worked on in the previous section in which case you 28 00:01:58,000 --> 00:02:02,020 want to click on the file menu and select project structure and make sure 29 00:02:02,020 --> 00:02:06,520 you click on sdk location if your on the welcome screen just click on configure 30 00:02:06,520 --> 00:02:10,509 and going to sdk manager both of those methods should take you to the same 31 00:02:10,509 --> 00:02:15,640 screen and what were looking for is this android sdk location so that's the 32 00:02:15,640 --> 00:02:17,410 location on my computer 33 00:02:17,410 --> 00:02:21,670 where the android software development kit was installed by Android studio so 34 00:02:21,670 --> 00:02:24,970 I'm actually going to select that path i'm going to copy it because we're going 35 00:02:24,970 --> 00:02:28,510 to need a little bit later so I'm just going to do a ctrl C to copy that 36 00:02:28,510 --> 00:02:32,140 because so going to paste and make a change at that shortly 37 00:02:32,140 --> 00:02:36,760 next is just going to come down and come up here rather and select terminal 38 00:02:36,760 --> 00:02:44,770 i'm actually gonna type in the commands sql lite 3 and you can 39 00:02:44,770 --> 00:02:48,490 see it says sql lite three is currently not installed you can install 40 00:02:48,490 --> 00:02:51,730 it by typing and that gives us the command to install up but we don't want 41 00:02:51,730 --> 00:02:56,770 to do that because sql lite 3 is actually in the android studio folder so 42 00:02:56,770 --> 00:02:59,680 instead what we're going to do is we're going to change the path to point to 43 00:02:59,680 --> 00:03:04,060 that folder if you got a message there and come up and said sql lite 3 44 00:03:04,060 --> 00:03:07,660 and perhaps a version number and was asking for some input what that means 45 00:03:07,660 --> 00:03:09,550 is it's already set up on your system 46 00:03:09,550 --> 00:03:13,240 you don't need to do the steps that I'm about to go through assuming that that's 47 00:03:13,240 --> 00:03:16,840 not the case and that you have got the same error that I got on the screen 48 00:03:16,840 --> 00:03:20,650 or one that similar saying that it's not installed then what we can do is 49 00:03:20,650 --> 00:03:26,290 continue on and add that path now the user path on Ubuntu linux is set by 50 00:03:26,290 --> 00:03:30,280 adding a command to the file .profile and if you're using a different linux 51 00:03:30,280 --> 00:03:34,600 distro and check to see which file you already have and bearing in 52 00:03:34,600 --> 00:03:39,340 mind maybe called bash_profile and if you have both been then used .profile 53 00:03:39,340 --> 00:03:43,630 in all cases the file will be in your home directory I've got a 54 00:03:43,630 --> 00:03:49,690 terminal session already opened so in there we want to type in gedit... 55 00:03:49,690 --> 00:03:54,220 ....because 56 00:03:54,220 --> 00:03:59,770 i'm running ubuntu linux and you can see that it says in the comments there's 57 00:03:59,770 --> 00:04:05,440 this file is executed by the command interpreter for login shells so what 58 00:04:05,440 --> 00:04:08,770 we're going to do is go right down to the end of the file very last line we're 59 00:04:08,770 --> 00:04:13,230 going to type an extra command to the file they're we type... 60 00:04:13,230 --> 00:04:20,649 .... 61 00:04:20,649 --> 00:04:26,320 ....next I'm going to paste in the Android SDK location that i took a copy 62 00:04:26,320 --> 00:04:29,320 of from Android studio by doing a ctrl v 63 00:04:30,290 --> 00:04:33,200 this is the path that's been added there making sure you don't add any 64 00:04:33,200 --> 00:04:37,250 extra spaces which can cause problems then the other thing we need to 65 00:04:37,250 --> 00:04:42,830 do is we need to put up / again after that then need to type... 66 00:04:42,830 --> 00:04:48,500 ....making sure you keep it in lower case then put a double quote into finish 67 00:04:48,500 --> 00:04:53,300 that line off that's what we need to do their so i'm going to save the changes and 68 00:04:53,300 --> 00:04:58,250 we can close the file at that point normally for those changes to take 69 00:04:58,250 --> 00:05:01,370 effect would have to close down would have to logout rather log back in again 70 00:05:01,880 --> 00:05:07,520 alternative to doing that is we can type... 71 00:05:07,520 --> 00:05:11,870 ....and bearing in mind for other distros that might be bash_profile 72 00:05:11,870 --> 00:05:17,450 or even another name but for ubuntu its .profile going to do that and 73 00:05:17,450 --> 00:05:20,960 that has reread that in and the only other thing i really need to do now is 74 00:05:20,960 --> 00:05:27,410 type in sql lite 3 so....and this time you can see instead of 75 00:05:27,410 --> 00:05:28,130 getting an error 76 00:05:28,130 --> 00:05:31,550 we've actually got the sql lite command-line interface popping up giving 77 00:05:31,550 --> 00:05:35,690 us a version number and it's actually actually giving us some tips to get help 78 00:05:35,690 --> 00:05:40,190 etc so that means that we type obviously the right path and sql lite 79 00:05:40,190 --> 00:05:43,370 is now ready to be used in which we going to be starting using it in the 80 00:05:43,370 --> 00:05:48,290 next video I'm going to type .quit to get out of that now and for the other 81 00:05:48,290 --> 00:05:51,740 command that we're going to be using later in the course that's ADB Android 82 00:05:51,740 --> 00:05:56,870 debug bridge we can just type in ADB and you can see that we've got a whole heap of 83 00:05:56,870 --> 00:06:00,740 mumbo-jumbo there but the bottom line is it's telling us that ADB is actually 84 00:06:00,740 --> 00:06:05,450 working and it's found it and were able to use that and later in the course we 85 00:06:05,450 --> 00:06:06,590 are putting that to good use 86 00:06:06,590 --> 00:06:10,190 so the bottom line now is at this point we're actually done we've got the command 87 00:06:10,190 --> 00:06:14,210 lines set up and we're ready to move on and start working with sql lite in 88 00:06:14,210 --> 00:06:16,070 the next video I'll see you in the next video