1 00:00:00,690 --> 00:00:03,800 Let's talk for a minute about the tools we're going to use for this project. 2 00:00:03,800 --> 00:00:06,870 In an effort to provide you with a consistent learning experience, we're 3 00:00:06,870 --> 00:00:10,640 providing the exact version of Android Studio used to record these videos, 4 00:00:10,640 --> 00:00:12,300 in the download links below. 5 00:00:12,300 --> 00:00:16,010 It includes the appropriate SDK and emulator image I'm using. 6 00:00:16,010 --> 00:00:17,650 If you download and use these tools, 7 00:00:17,650 --> 00:00:20,580 then everything should match up as long as you don't update anything. 8 00:00:20,580 --> 00:00:22,460 Now, don't worry, if you do update or 9 00:00:22,460 --> 00:00:26,200 if your version of Android Studio is a little different than what you see here. 10 00:00:26,200 --> 00:00:28,650 Our developer tools are constantly evolving, but 11 00:00:28,650 --> 00:00:30,900 the main pieces will still be the same. 12 00:00:30,900 --> 00:00:32,490 And more importantly, the code and 13 00:00:32,490 --> 00:00:34,880 the concepts we are covering here are less volatile. 14 00:00:34,880 --> 00:00:37,600 So even if the tools are a little bit different, the code and 15 00:00:37,600 --> 00:00:40,200 the ways to solve problems will still apply. 16 00:00:40,200 --> 00:00:43,290 If you really get stuck because of Android Studio, you can either get help from our 17 00:00:43,290 --> 00:00:46,950 Treehouse community or reinstall these versions of the tools. 18 00:00:46,950 --> 00:00:49,030 You can even have more than one version installed at a time. 19 00:00:50,240 --> 00:00:51,840 As usual if any minor changes or 20 00:00:51,840 --> 00:00:56,880 bugs pop up in these videos, then we will add a visual call out like this. 21 00:00:56,880 --> 00:00:59,500 And then I'll add notes for screenshots in the teacher's notes. 22 00:00:59,500 --> 00:01:02,650 So if you spot a difference, check the notes first and then let us know. 23 00:01:04,260 --> 00:01:07,590 Remember it's really important to follow along and not just watch these videos, 24 00:01:07,590 --> 00:01:10,370 because you will learn so much more. 25 00:01:10,370 --> 00:01:13,180 If you get stuck with your own code, you can always download the project 26 00:01:13,180 --> 00:01:16,210 files on each video page for my code from the video. 27 00:01:16,210 --> 00:01:19,630 Which you can then use for comparison or as a starting point for your own work. 28 00:01:21,040 --> 00:01:23,269 Okay, make sure you have Android studio set up how you want it and 29 00:01:23,269 --> 00:01:24,400 then let's start the project. 30 00:01:25,620 --> 00:01:28,070 Okay, so once Android Studio loads up, 31 00:01:28,070 --> 00:01:31,177 let's click on Start a New Project here at the top. 32 00:01:31,177 --> 00:01:34,110 The first thing we need here is a name for our application. 33 00:01:34,110 --> 00:01:36,650 Let's call this Interactive Story. 34 00:01:38,230 --> 00:01:42,630 Now my company domain was already filled in with teamtreehouse.com, but 35 00:01:42,630 --> 00:01:44,280 you can use whatever you'd like here. 36 00:01:44,280 --> 00:01:47,480 Whether it's your own organization, or perhaps just your own name. 37 00:01:47,480 --> 00:01:48,030 For example, for 38 00:01:48,030 --> 00:01:52,570 my personal projects I will often just use jakuben.com as my personal domain. 39 00:01:53,700 --> 00:01:56,830 One thing I should note is that you do want to use just lowercase letters and 40 00:01:56,830 --> 00:01:58,330 periods like we have here. 41 00:01:58,330 --> 00:02:00,610 You don't want to use any other special characters or 42 00:02:00,610 --> 00:02:02,740 uppercase letters as they may cause problems. 43 00:02:03,780 --> 00:02:07,310 So moving on, we see the package name is generated down here with the domain name 44 00:02:07,310 --> 00:02:09,730 and then the project name here at the end. 45 00:02:09,730 --> 00:02:11,962 I'm going to change my project location, 46 00:02:11,962 --> 00:02:14,324 though you certainly don't have to do this. 47 00:02:14,324 --> 00:02:17,620 I'm gonna change this to Development and click Next. 48 00:02:17,620 --> 00:02:21,620 Now on this screen we want to select the form factors that our app will run on, 49 00:02:21,620 --> 00:02:24,710 as well as the Minimum STK that we wanna target. 50 00:02:24,710 --> 00:02:27,190 This app is just going to be for phones and tablets, so 51 00:02:27,190 --> 00:02:28,920 we don't need to check anything else. 52 00:02:28,920 --> 00:02:33,050 And we can accept the default minimum SDK, which, at the time of this recording, 53 00:02:33,050 --> 00:02:33,880 is API 16. 54 00:02:33,880 --> 00:02:36,550 Don't worry if your minimum version is different. 55 00:02:36,550 --> 00:02:40,290 Backwards compatibility is easier than ever thanks to some changes in how Android 56 00:02:40,290 --> 00:02:41,850 handles API versioning. 57 00:02:41,850 --> 00:02:44,700 Notice that this tell us that by going with this default setting, 58 00:02:44,700 --> 00:02:50,450 our app will run on approximately 95.2% of devices active on the Google Play Store. 59 00:02:50,450 --> 00:02:52,070 And that's pretty much our market, 60 00:02:52,070 --> 00:02:54,800 since we're developing apps we want to be available on Google Play. 61 00:02:54,800 --> 00:02:58,730 And this lets us use some of the newer and more stable features of Android, 62 00:02:58,730 --> 00:03:02,600 without having to worry about backwards compatibility from much older devices. 63 00:03:02,600 --> 00:03:04,210 If we click on Help me choose, 64 00:03:04,210 --> 00:03:06,810 we can see a further breakdown of what people are using. 65 00:03:06,810 --> 00:03:09,190 I'm gonna click OK and click Next. 66 00:03:09,190 --> 00:03:12,510 Now in this screen, we want to select one of these project templates. 67 00:03:12,510 --> 00:03:15,490 We can see a bunch of different types of activities here for 68 00:03:15,490 --> 00:03:16,910 different types of screens. 69 00:03:16,910 --> 00:03:19,820 You might think this basic activity would be appropriate but we don't want 70 00:03:19,820 --> 00:03:23,470 to include this floating action button, or FAB, that we see down here. 71 00:03:23,470 --> 00:03:27,070 So, with empty activity selected, let's click Next. 72 00:03:27,070 --> 00:03:30,420 The default name here, Main Activity, is fine because the default activity 73 00:03:30,420 --> 00:03:33,460 will be the main activity that runs when our app launches. 74 00:03:33,460 --> 00:03:37,163 Let's leave the layout name as it's generated and then make sure that this 75 00:03:37,163 --> 00:03:40,235 Backwards Compatibility box is checked for app compat here. 76 00:03:40,235 --> 00:03:42,560 We'll talk a little bit more about this later, okay? 77 00:03:42,560 --> 00:03:43,320 Let's click Finish. 78 00:03:47,620 --> 00:03:50,310 Okay, once we get to this screen, our project is ready. 79 00:03:50,310 --> 00:03:53,880 We can see down here there's a message that our gradle build finished. 80 00:03:53,880 --> 00:03:56,160 Now before we continue, I wanna show you one thing. 81 00:03:56,160 --> 00:04:00,160 Expand this gradle scripts section here on the left, and then double 82 00:04:00,160 --> 00:04:04,790 click on the second build.gradle file, the one that has module:app shown after it. 83 00:04:04,790 --> 00:04:07,460 We haven't talked much yet about Gradle. 84 00:04:07,460 --> 00:04:11,230 But that's the build system that sets a bunch of configuration parameters for 85 00:04:11,230 --> 00:04:12,260 our projects. 86 00:04:12,260 --> 00:04:15,020 At some point, you will likely need to make changes to this file 87 00:04:15,020 --> 00:04:17,570 as new versions of Android and Tools are released. 88 00:04:17,570 --> 00:04:20,270 But for now, I just want to give you a quick tour of what we see here. 89 00:04:20,270 --> 00:04:23,590 Notice that there are a few different settings about SDK versions. 90 00:04:23,590 --> 00:04:27,190 Up here, we have the compile SDK version and it's set to 25, 91 00:04:27,190 --> 00:04:31,360 which is the latest version I currently have installed on my computer. 92 00:04:31,360 --> 00:04:34,750 This is the version of the SDK that you have installed that's used to 93 00:04:34,750 --> 00:04:35,990 compile your app. 94 00:04:35,990 --> 00:04:38,580 But it can still run on older versions of the SDK, 95 00:04:38,580 --> 00:04:41,260 down to the minimum which we see here. 96 00:04:41,260 --> 00:04:45,210 And here we see the number 16 which is what we selected in our project wizard. 97 00:04:45,210 --> 00:04:48,390 Then we have the target SDK version which is often the same 98 00:04:48,390 --> 00:04:50,500 as the compile SDK version. 99 00:04:50,500 --> 00:04:53,910 This represents the SDK which we've tested our app against, and 100 00:04:53,910 --> 00:04:55,370 if it's set to something different, 101 00:04:55,370 --> 00:04:58,830 it may enable compatibility behaviors automatically for us. 102 00:04:58,830 --> 00:05:01,990 So anyhow, if you need to change any of these after you first create the project 103 00:05:01,990 --> 00:05:05,250 like when a new version of the SDK is available, you can come in here and 104 00:05:05,250 --> 00:05:07,040 change the values directly. 105 00:05:07,040 --> 00:05:10,370 Now if you're wondering how to get all these different versions of the SDK, 106 00:05:10,370 --> 00:05:12,130 you can use the SDK Manager. 107 00:05:12,130 --> 00:05:15,742 Which is this little icon here, with the arrow pointing into the Android's head. 108 00:05:17,480 --> 00:05:18,859 So if we click on that, 109 00:05:18,859 --> 00:05:22,792 it will show what is installed in our version of Android Studio. 110 00:05:22,792 --> 00:05:26,075 This is where we can come and download newer versions as they become available, 111 00:05:26,075 --> 00:05:28,480 although Android Studio will also prompt us. 112 00:05:28,480 --> 00:05:32,040 Okay, I'm going to close this with Okay, and close this gradle file, 113 00:05:32,040 --> 00:05:35,350 and we're back in our app, and we're ready to continue. 114 00:05:35,350 --> 00:05:37,120 Let's take a short break, and then we'll start coding.