From the course: Android Development Essential Training: Manage Data with Kotlin
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Add Retrofit and coroutine dependencies
From the course: Android Development Essential Training: Manage Data with Kotlin
Add Retrofit and coroutine dependencies
- [Instructor] You can work with web services from Android in many different ways, but most Android developers use an open source library named Retrofit that was developed by Square, the company known primarily for its credit card processing service. I'll show how to get started with Retrofit, how to add the dependencies you need, how to define a service interface, and then how to retrieve data from a service at run time. First we need dependencies. I'm going to need a few of them and it'll take some typing, so instead I've placed them in a gist, which you can open with this short URL git.io/fjrsW. That'll expand to this URL and you can select and copy all this code. Then back in Android Studio, go to your build.gradle file for the app module and paste the code at the bottom of the dependency section. Click Sync Now. If you're prompted to upgrade your versions of Retrofit or Coroutines, you can accept that, it should work fine. Now let's talk about these dependencies. The first two…