For this course, the instructor has included exercise files, pre-created files that will allow you to mimic what the instructor is doing on your own computer. The files come as ZIP packages made up of all the materials you'll need, including JAR files; assets; feeds, such as JSON and XML; images; and PHP files. This video details how to use the exercise files for practice with developing Android apps with RESTful services.
- View Offline
This course is accompanied by exercise files that you can use to follow along with the demonstrations I do 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 folder. One folder for each chapter in the course. Within the folders, you'll find ZIP files. Each of these ZIP files is an Eclipse archive file, designed to be imported into Eclipse with the Android Developer Tools, or ADT.
To import a project, go to Eclipse and select File > Import. Look at the General category and choose Existing Projects into Workspace and click Next. Choose Select archive file, Browse, and choose the archive file you want to import. Then follow the rest of the prompts to import the project. You should then be able to open the Java files and other resources that are available within the project. If you prefer to use Android Studio, you can take any of these ZIP files and extract them anywhere on your hard disk.
I'll extract this ZIP file right here in this folder. On Mac, you can simply double-click and on Windows, you can right-click and choose Extract All and then Extract. Now, I'm going to make a copy of this string. This is the path where I've extracted my project. Then I'll go to Android Studio and from the welcome screen, I'll choose Import Project. I'm using Android Studio 0.5.9. Make sure you're using at least that version. And because Android Studio is evolving so quickly, if you're using a more recent version, this process might look a little bit different.
Now, I'm going to paste in that path. I'll open that folder and go to the folder that actually includes the project. Then I'll click OK and then I'll choose a folder where I want to create a new copy of the project that uses the standard directory structure for Android Studio. I'll call this new project Parallel Tasks for the name of the project and place it under my home directory. On this screen, there are options that will determine how your project is imported.
I'll accept all of the options and click Finish, and after a few moments, my project will be imported. Be patient the first time you import a project. You might get a message saying that the sync failed, but notice on my screen that after just a few moments, that message was cleared. And down at the bottom of the screen, I see a message that my Gradle build finished. You might see some warnings along the way, but if you don't see any errors, then you should be able to work with your project in Android Studio.
I do recommend reading through the import summary file that will be generated. It'll tell you about files that might be ignored, JAR files that might be converted to something called dependencies, and files that have been moved around to match the correct directory structure. In addition to the Android app projects, the Exercise Files folder also includes a couple of other subfolders. The Assets folder contains copies of assets I use during the course. The Feeds folder includes static copies of the JSON and XML feeds that I use.
The Photos folder contains copies of the image files, and the PHP folder contains copies of the PHP files. Now, the contents of all those folders are hosted on a public website at services.hanselandpetal.com. For example, the photos are stored here, and the versions in the website are what I'll actually be using during the course. I'm providing these local versions just for your convenience. The fourth folder under Assets include copies of JAR files.
These are libraries that I use during one of the chapters in the course. You're able to download all of these libraries from their vendor websites, but in order to make sure that you can use the same versions that I use, I'm providing copies here. The last subfolder under Exercise Files is the Solutions folder and there are versions of each of the Android app projects here, each with a suffix of solution. This will allow you to open up both the starting and the finished version of any project and compare them to each other.
- Working with background threads
- Defining background tasks
- Requesting content with HTTP requests
- Parsing web service responses
- Downloading data, including images
- Sending HTTP parameters to the server
- Using higher-level client libraries like Volley and OkHttp
- Managing an app's networking abilities