In this video, learn how to define the objects that will be used in your API calls. You will be working with the GitHub API, so you will learn how to create classes for a Gist, a Gist comment, a Gist file, and a GitHub user using only primitive types to start.
- [Instructor] Now that I have the packages I need…to use Retrofit implemented into my Android project,…I can start connecting my app to the GitHub API.…The first thing we need to do is define our data models.…These are classes that we define in our Android project…that our chosen data converter tries…to map the data sent back from the API to.…Let's go over the classes…that need to be defined in this app.…I will be defining these classes…so that they work for the JSON data converter.…
But you should still be able to follow along…if you're using the Moshi converter.…The only difference is that you will need…to add a JSON adapter to Moshi to handle DateTime data.…You can find more info on that in the adapter section…of the Moshi GitHub repository here.…To figure out what classes I need to define…for my data models, I read through…the GitHub API documentation which you can check out here.…To start, we are going to need a Gist class.…
Gists have comments, files, and authors…which we will also need to define classes for.…
- REST API basics
- Methods for reading and writing data
- Defining data models with Retrofit
- Implementing an API interface
- Getting data with a Retrofit call
- Authorizing requests
- Putting, deleting, and posting data
- Customizing the data converter
- Working with the request and response headers
Skill Level Intermediate
Android App Development: Enterprise Integrationwith Jon-Luke West47m 51s Intermediate
Android App Development: Data Persistence Librarieswith Annyce Davis4h 52m Intermediate
1. HTTP APIs
2. Get Started with Retrofit
3. Finish the Sample App
4. More Configuration Options
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.