Android Networking
You will learn about working with REST APIs to transfer data over a network, including making basic connections and also using the popular Retrofit library. By Joe Howard.
Part 1: Networking Basics
Find out what's covered in our Android Networking video tutorial series: HTTP basics, HttpUrlConnection, and using the Retrofit library from Square.
Download the starter app, build it in Android Studio, and review the existing app code. Review the use of ViewModel, LiveData, and the Repository pattern.
Learn about basic concepts of HTTP requests, JSON, using REST APIs and consuming responses, and use the Postman REST client to investigate the GitHub API.
See how to check for network connectivity from the starter app, and setup network state access permissions.
Use the HttpUrlConnection class, along with an AsyncTask, to query the GitHub repos API for any GitHub user.
Practice what you've learned so far to query the GitHub API and retrieve a list of code gists for any GitHub user.
Learn how to parse the structured HTTP data responses from a REST API using JSONObject and JSONArray.
Practice what you've learned about parsing JSON responses to parse the code gists JSON data for any GitHub user.
Practice all that you've learned about making HTTP connections and parsing JSON data to retrieve and display a GitHub user's profile information.
Let's review what you've covered on networking basics in this first part of Android Networking, and then discuss what's next.
Part 2: Getting Started with RetroFit
We'll review the various issues with making HTTP connections from Android, then see a preview of how the Retrofit library from Square can help.
Learn about how to setup the Retrofit library and Gson parsing library as dependencies for your Android project.
See how to make a basic GET request using Retrofit, and also see how to use the Android Profiler to monitor network requests.
Practice what you've learned about making GET requests with Retrofit to retrieve a GitHub user's gists and profile.
Use the Gson parsing library from Google to automatically parse the response data from Retrofit requests into Kotlin instances.
Practice what you've learned about Gson and Retrofit to show the user profile data obtained from GitHub.
Setup an HttpLoggingInterceptor for an OkHttp client and use the client with your Retrofit instance.
See how to handle errors that occur when making API requests with Retrofit by creating an Either class that can represent both success and error.
Practice what you've learned about error handling to handle errors that occur when making requests for GitHub repos and gists.
Let's review what you've covered about getting started with Retrofit in this second part of Android Networking, and then discuss what's next.
Part 3: More with RetroFit
Survey other capabilities of the Retrofit library, and preview the network requests that will be seen in this part of the course.
Learn how to authenticate into a GitHub user's account by retrieving an OAuth2 token from the GitHub API.
Use an interceptor to add the OAuth2 token into requests made by Retrofit, and then make POST requests to add a new gist into the user's GitHub account.
Practice what you've learned about making POST requests to send more data back when creating a new gist for the authenticated GitHub user.
Learn how to make a DELETE request with Retrofit and then add the ability to delete gists for the authenticated GitHub user.
Practice all that you've learned about Retrofit to send an update request for profile data for the authenticated GitHub user.
In this final episode, we'll summarize both this last part and the whole course, and then see an overview of Android networking topics that were not covered.