The course is accompanied by exercise files you can use to follow along with the exercises. They're organized as Android Studio projects that you can import into Android Studio 2.3.3 or later.
- [Instructor] This course is accompanied by exercise files that you can use to follow along with the demonstrations on screen. I've copied the exercise files to my desktop, but you can place them anywhere on your hard disk. The exercise files are organized by chapter, with one folder for each chapter, sub-folders for each video, and within those folders, folders that are organized as Android Studio projects. You can recognize a directory that's set up as an Android Studio project by the presence of an IML file.
You'll also see an app directory, and that's where your app module is, your actual application. On Windows, you'll see this .idea directory. It contains configuration files for Android Studio, but that directory is also present on Mac, it's just invisible by default in Finder. In order to use any of these exercise files, start at Android Studio's welcome screen. Choose open an existing Android Studio project, then, if you copied the exercise files to your desktop, press Control + D on Windows or Command + D on Mac and that'll take you to the desktop directory.
Go to the exercise files directory, then go to the video directory that you're interested in, select the directory with the Android Studio icon, and click OK. The first time you open any of these projects in Android Studio, there might be a delay while certain components are downloaded to your system. Once the project is open though, you'll be ready to start coding and testing. If you see any prompts to upgrade your project, for example, to the latest gradle plugin, or to a newer version of a particular library or API level, always accept that prompt and do the upgrade.
At the beginning of each video, I frequently have certain files open, but when you open the project, it'll look like this with an empty central area. You can open particular files by pressing shift twice, that takes you to the search everywhere prompt, and then you can type in a file name. For example, main activity. I'll select that, and that opens the main activity class. To locate that file in your project, go to the project window, and then click on this icon which is labeled Scroll from Source, and that will open the directory where that file is stored.
The Android scope is a filtered scope. It doesn't show you everything in the project. If you want to see the entire project and its files and folders, as they're stored on your file system, go to the project scope and then you'll see absolutely everything that's in that directory. To test your application, go to the tools menu and select Android, AVD Manager. And set up virtual devices representing the operating system versions and the screen sizes that you want to test with.
I'll be testing with a variety of virtual devices, starting with an emulator for a Nexus 5, running on Android 4.4 KitKat, all the way up through a Pixel C and a Pixel XL. The Pixel XL is running on API 26. That's for the next version of Android, Android 8.0, as of the time of this recording, known as Android O. In addition to the projects included in the exercise files, there's a solutions directory that contains the finished versions of each project.
You open these exactly the same way you do with the beginning projects. So if you prefer, instead of working through the projects yourself, you can simply look at the finished versions. Finally, there's an assets directory that contains a variety of resources, including finished applications, image files, and even some software that I'll show you how to use later on in the course.
- Supporting different platform versions
- Setting minimum and target platforms
- Working with multiple screens
- Creating alternative resource directories, XML layout files, and bitmap resources
- Creating dynamic UIs with fragments
- Creating a project with fragments
- Controlling a fragment with Java code