Android Networking

Mar 28 2018 · Video Course (1 hr, 46 mins) · Beginner

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.

Version

  • Kotlin 1.2, Android 4.4+, Studio 3.0.1

Networking Basics

Introduction

2:03 Free

Find out what's covered in our Android Networking video tutorial series: HTTP basics, HttpUrlConnection, and using the Retrofit library from Square.

1

The Starter App

2:33 Free

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.

2

HTTP Basics

3:24 Free

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.

3

Check Connectivity

2:47 Free

See how to check for network connectivity from the starter app, and setup network state access permissions.

4

HttpUrlConnection

10:47 Free

Use the HttpUrlConnection class, along with an AsyncTask, to query the GitHub repos API for any GitHub user.

5

Practice what you've learned so far to query the GitHub API and retrieve a list of code gists for any GitHub user.

6

Learn how to parse the structured HTTP data responses from a REST API using JSONObject and JSONArray.

7

Practice what you've learned about parsing JSON responses to parse the code gists JSON data for any GitHub user.

8

Practice all that you've learned about making HTTP connections and parsing JSON data to retrieve and display a GitHub user's profile information.

9

Conclusion

0:53

Let's review what you've covered on networking basics in this first part of Android Networking, and then discuss what's next.

10

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.

11

Learn about how to setup the Retrofit library and Gson parsing library as dependencies for your Android project.

12

See how to make a basic GET request using Retrofit, and also see how to use the Android Profiler to monitor network requests.

13

Practice what you've learned about making GET requests with Retrofit to retrieve a GitHub user's gists and profile.

14

Use the Gson parsing library from Google to automatically parse the response data from Retrofit requests into Kotlin instances.

15

Practice what you've learned about Gson and Retrofit to show the user profile data obtained from GitHub.

16

Setup an HttpLoggingInterceptor for an OkHttp client and use the client with your Retrofit instance.

17

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.

18

Practice what you've learned about error handling to handle errors that occur when making requests for GitHub repos and gists.

19

Conclusion

0:48

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.

20

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.

21

Learn how to authenticate into a GitHub user's account by retrieving an OAuth2 token from the GitHub API.

22

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.

23

Practice what you've learned about making POST requests to send more data back when creating a new gist for the authenticated GitHub user.

24

Learn how to make a DELETE request with Retrofit and then add the ability to delete gists for the authenticated GitHub user.

25

Practice all that you've learned about Retrofit to send an update request for profile data for the authenticated GitHub user.

26

Conclusion

1:45

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.

27

Contributors

Comments