Getting to Know Our Tools4:52 with Ben Deitch
Before we start changing anything, let’s take a brief tour of our tools so we can get familiar with what’s on the screen and where we write code or make changes.
[MUSIC] 0:00 Before we start changing anything, let's take a brief tour of our tools so we can 0:04 get familiar with what's on the screen and where we write code or make changes. 0:08 The very first thing we want to do is start our emulator. 0:13 You may already have it up and running from the previous stage. 0:17 But if you don't, it's a good idea to start it ahead of time, so 0:20 it'll be ready when you need it. 0:22 Up here in the tool bar are a few Android buttons. 0:24 This one with the phone is our Android Virtual Device Manager. 0:27 And here just select the virtual device you want to run, and 0:31 then click on the Start button. 0:35 Once the emulator window appears, we can safely close our Virtual Device Manager. 0:38 We don't need to leave it open to use the emulator. 0:44 All right, while that's loading, let's take a look at Android Studio. 0:47 On the left-hand side, there should be a view for the project structure. 0:51 If it's missing or you accidentally close it, what you can do with 0:56 this button right here, you can reopen it with this same button. 0:58 Or you can either go up to View > Tool Windows > Project. 1:03 Or you can go down to the bottom, and 1:09 as we saw before, you can select Project or other windows from here. 1:11 Also, remember that clicking this icon toggles whether or 1:18 not we can see the Tool Window shortcuts around the screen. 1:21 The project view is where we can see all the files and 1:24 folders that make up our project. 1:27 By default, Android Studio displays our project files in the Android Project View. 1:29 The Android Project View shows a trimmed down version of your project 1:34 that provides quick access to the most important files for Android development. 1:38 Let's click here and switch to the Project View. 1:42 This view shows our entire project. 1:47 Here we can see our FunFacts folder at the top. 1:49 Let's expand that. 1:52 Also, notice that our FunFacts folder is in our Android Studio Projects folder that 1:55 we used when we first created the project. 2:00 In fact, if we switch to Finder or Windows Explorer, 2:03 we can navigate to our project, And sure enough, 2:06 we see that these files and folders match up with what we see over here. 2:12 The most important folder in our project is the app folder. 2:16 It contains all the resources and raw materials that make up our app. 2:20 Let's take a look inside to see how it's structured. 2:24 At the top is a build directory which contains all the files that are built for 2:28 us by Android Studio. 2:32 We shouldn't ever need to change anything in the build directory. 2:34 The next one is Libs which is short for Libraries. 2:37 It contains any optional libraries of code we might need in our project. 2:41 This will be empty for this project but 2:45 we'll show more on how to use libraries in later courses. 2:47 Next up is SRC. 2:50 This is the important directory and it's short for source. 2:51 I know source isn't that long of a word, but programmers love abbreviations. 2:55 If we expand source, we can see three more folders. 3:00 The Android test and test folders are used for different kinds of testing. 3:04 But let's save those for later. 3:08 We are more concerned with the main folder. 3:10 Inside main are all the files we'll be working with. 3:13 Java files are placed here in Java folder, 3:16 and then below, we have res, which is short for resources. 3:19 Resources are everything that we see or hear in an app. 3:23 So in addition to images and sounds, it also contains the layout files for 3:27 how our screens will be laid out. 3:31 If we keep going further, then inside res, we find the layout folder. 3:33 And in here is one file named activity_fun_facts.xml. 3:39 This is the file that is already opened over here. 3:43 That's enough about project structure. 3:47 Let's change back to the Android view so 3:50 we don't have to do as much digging to find the files we want. 3:51 So click up here, and then pick Android. 3:55 Great, now over here, this is the main section for writing code, or 3:59 designing screen layouts. 4:02 We're currently looking at the Design view for the activity_fun_facts layout file. 4:04 The Design view is a drag and 4:09 drop editor that lets us visually manipulate the screen layout. 4:11 In the middle is a preview of how it should look on a device, and 4:14 it looks just like what we saw a few minutes ago when we ran the app. 4:18 Next to the preview is a blueprint view, 4:21 which shows us a little more detail about how all our views are positioned. 4:24 When designing screen layouts, 4:27 sometimes we want to modify the code directly instead of using the design view. 4:29 To modify the XML code, we can just click on the Text tab here at the bottom. 4:33 Also, if you've clicked on the Text tab and you're not seeing a preview over here, 4:38 you can show and hide the preview by clicking on thisPreview button. 4:42 All right, that should be enough to get us started. 4:47 In the next video, we'll start making some changes. 4:50
You need to sign up for Treehouse in order to download course files.Sign up