Setting Up the Project3:42 with Ben Jakuben
Let's take a look at the starter files we need to work on the Music Machine app for this course.
If you already have the app as a project from an earlier course then you may want to use that for this course, but you'll need a few things for some of these examples. I'd recommend using the version of the project supplied here:
If you need a refresher on Git and/or GitHub, check out the following material:
If you already have the MusicMachine app as a project from an earlier course, 0:00 then you may want to use that for this course. 0:04 But you'll need a few things for some of these examples. 0:06 I'd recommend starting with the version of the project I'm supplying here, but 0:09 the starter code is available on GitHub if you want to copy new things as needed 0:13 into your own project. 0:17 With that said, check the links in teacher's notes for the starter files. 0:18 Take a moment to download them or clone the project from GitHub and 0:22 then we can walk through opening it up for the first time together. 0:25 Importing a project can be kind of a headache 0:30 when the Gradle settings have changed, which they often do. 0:32 If nothing else follow along to see how to troubleshoot some common issues and 0:35 if you get stuck ask for help from the treehouse community. 0:39 All downloaded? 0:43 Cool, I've got Android Studio open here. 0:44 As usual, don't worry if your version of Android Studio 0:47 is a little different than what you see here. 0:49 Our developer tools are constantly evolving, but 0:52 the main pieces will still be the same. 0:54 More importantly, the code and concepts we are covering here are less volatile. 0:56 So even if the tools are a little bit different, the code and 1:00 ways to solve problems will still apply. 1:03 So I want to open an existing Android Studio project and 1:06 I cloned mine from GitHub in the development directory. 1:09 So I'll select the project and click OK. 1:12 Cool. 1:17 You may see a warning up at the top about the Android SDK if you do just click OK. 1:18 It happens sometimes because the SDK settings 1:23 in the project of the original author may be different than your own. 1:26 So the first thing we usually need to do when we import a project, 1:30 is to fix it's Gradle settings. 1:33 You're probably familiar with this already, but let's walk through it. 1:35 Down here we see that the project currently expects a different version 1:38 of the Android build tools. 1:41 We could install this version here, but it's an older version and 1:43 we usually want it to update to the latest version. 1:46 So instead, let's open up the build.gradle file for our app. 1:49 Click on Project and, well, there are multiple build.gradle files in here so 1:53 how do we know which one to use? 1:57 Well, click into App and this is the one for our app project so 1:59 double click on build.gradle and here we see the value for our build tools version. 2:03 Next question, how do we know what the latest value is that we should use here? 2:08 We can check in the SDK manager. 2:13 So click up here on the little down arrow for the SDK manager then click on SDK 2:15 tools and up here at the top we have the Android SDK build tools and, this 2:20 one is telling me that I have an update available on an early release channel. 2:25 Well, I want to ignore that for now. 2:30 To see my current version, and 2:31 you may need to do this too, click on Show Package Details down here, and then scroll 2:33 through the list to see what the highest number is that you have installed. 2:38 So here you see the check box I have mine as 23.0.3. 2:41 So click OK, go back to the file 2:43 update to the latest version and then let's sync our changes. 2:46 No, another error! 2:53 This older version of the project is using an older version 2:54 of the Android Gradle plugin. 2:57 If you see this, feel free to click Update. 2:59 That will fix the setting and the Gradle sync should now complete successfully. 3:02 Whoops, we have one more error. 3:05 Go ahead and click on Fix Gradle Wrapper and re-import the project and 3:07 it'll sync again, and this time we're good to go. 3:11 Let's run it to make sure that it's working. 3:15 Click on the Run button, and I already have my emulator running so 3:17 I'm going to click that and select Use same selection. 3:20 Click Okay, and now I'll bring my emulator onto the screen as it loads. 3:24 Okay, so here's our app. 3:33 Looks like it's working. 3:35 We're ready to go. 3:36 Coming up next we'll revisit how to pass data from one activity to another. 3:37
You need to sign up for Treehouse in order to download course files.Sign up