This video series includes exercise files that you can use to follow along with the demonstrations on screen. David has copied the exercise files to his desktop, but you can place them anywhere on your hard disk. The exercise files include sample apps packaged as Android Studio projects, and a variety of other files used during the course.
- [Teacher] 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. There are four directories in the exercise files that are organized by chapter. One directory for each chapter, and one subdirectory for each video. Within each of the subdirectories, you'll find a directory that's set up as an Android Studio project. You can identify these projects by the presence of a .idea folder which is only directly visible in Windows, but might be hidden on Mac, but you'll also see subdirectories named App and Gradle.
To open any of the projects in Android Studio, make sure you're using at least Android Studio version 2.2. From the welcome screen, choose Open an Existing Android Studio Project. In the opener file project dialogue, you can press CTRL D on Windows or Command D on Mac to jump to the desktop directory, then go to your exercise files directory to the appropriate chapter and video directory and then the subdirectory should be marked by an Android Studio icon.
Select it, click OK, and that will open the project. If you're using a more recent version of Android Studio than 2.2, you might be prompted to update the Gradle plugin. If so, accept the prompt, and that will update your Gradle build files. It's also useful to go to your Gradle scripts, to the build.gradle file for the application, and see if there are any suggested updates to any of the files here. For example, when I created the original project, the most recent version of the appcompat library, that the support library, was 24.2.1.
Since then there's been an update, so I click in there and press ALT or Option and then enter a return for an intention action, and change to the most recent version. Whenever you make a change to your Gradle files, you'll need to resync the project and you can do that by clicking the link in the upper right corner. You should then be able to run your app on any device starting at the minimum SDK version of 15 and a maximum SDK version of 24 which matches Android 7 Nougat.
Throughout this course, I'll be using a virtual device to run all of my apps. That's because in this course on data persistence, the virtual device will give me complete access to the local storage areas. That's something you won't get on a physical device unless the device has been rooted. So I suggest using a virtual device throughout this course. Also you'll notice that in certain videos, I'm using a device running on API 23, that's Android 6 Marshmallow, and that's because of a bug that currently exists as of the time of this recording in the Android Device Monitor when you're working with devices that are running on Android 7.
You can get to the Android Device Monitor through the menu in Android Studio and when you open it, you can actually see the complete storage area on the device that's connected through ADB. This won't work right now on devices that run Android 7, either physical or virtual devices. So for most of these demonstrations, I'm using the older operating system but functionally, everything I'm showing you works exactly the same on both versions of Android. The exercise files directory also has a subdirectory named Assets, and it has three subdirectories, Files, Images and Launcher.
The Launcher directory contains my Launcher icon for this application. You probably won't need to use this. All of the sample apps already have the Launcher, but I provided all the different versions you might need if you want to use this icon in other contexts. The Images directory contains copies of all the images I used throughout the application. And again, you'll find plenty of copies of these in the sample apps, but I'll show you how I added these images to the app during the course. And finally, there's a subdirectory named Files.
It contains an XML file called colors_green_line, and this is a material design palate that I created and am using throughout the course. There are also copies of files that I create at different points during the course. There's a menuitems JSON file, a my_global_prefs XML file, and an SQL Light three database file named nadias.db. The file extensions for all of these files are hidden on Windows, but they are there, and I'll show you how all of these files are created or used during the course.
The exercise files also include a Solutions subdirectory which contains copies of all of the different exercises, but these are the thinest versions of the exercises. And finally, there's a subdirectory called StartingApp which is an Android Studio project, and it has a copy of the sample application in it's beginning state. And this is the app that I'll be using throughout the course. And I'll take you on a walk through of that app in the next video.
- Modeling data in POJO classes
- Customizing a ListView item display
- Displaying data in a RecyclerView
- Creating a custom array adapter
- Managing shared preferences with Java
- Creating and importing JSON data files
- Accessing SQLite from the command line
- Retrieving data with SQLite queries