Skip to content
0:00 / 0:00

#retrofit#kotlin#okhttp

Retrofit - Send a simple GET Request | Android Studio Tutorial

Stevdza-San

95K subscribers • 4 videos on Hallway

YouTube
  • Recommended by 1 person: 1 in engineering communities.
  • May be out of date. The tools, versions or practices it shows have likely moved on.

Beginner. No background in the topic needed.

103K views6 years ago1 recommendation

Mobile developmentAndroid and Jetpack ComposeNetworking and protocols

Stevdza-San shows how to set up Retrofit to send a simple GET request, parse JSON, and display the data in an Android app.

🏆 My Online Courses ⭐Discount Coupon: LAUNCH-STEVDZA-SAN stevdza-san.com 🐱‍👤 Wanna become a member? Join! youtube.com/channel/UCYLAirIEMMXtWOECuZAtjqQ/join 📸 Instagram instagram.com/stevdza_san/ Retrofit is a Type Safe REST client for Android Developed by square. It uses okHttp library for HTTP requests, and it's one of the best tools for performing network requests in android applications. In this video I'll show you how to send a simple GET request, receive a result in JSON, convert it to Kotlin object and display it back in our app. So with this video I'm starting a new short tutorial series about Retrofit library, so stay tuned! Retrofit requires three main components: 1. Retrofit Instance: We can create an instance of Retrofit by Retrofit.Builder class. And we have to specify the base url and converter factory at the time of the Retrofit instance creation 2. Model Class: Retrofit needs a Model class for sending and receiving Request. It uses the model class for parsing server Response by using converters like Gson, Moshi etc. 3. An Interface for possible API calls: The interface contains methods that represents possible API calls. Each methods need a base Url end point annotation that represents the Http methods like GET, POST etc. Timestamps: - Introduction - Create Model class - Create SimpleApi interface - Create Constants class - Create RetrofitInstance object (Singleton) - Create Repository - Create MainViewModel class - Create MainViewModelFactory class - Implement the logic - Handle Exceptions

Why it's here

1 person recommends this

What people say. Recommended as a fundamental tutorial for learning network requests in Android development.

u/GamerFan2012in r/Kotlin • Recommends

On “Best Kotlin Books for Beginners and Developers Must know”

As someone who as been in Android for about 15 years here. I posted this a few days ago but I'll one again copy and paste for you.... Philip Lackner link to this video Coding with Mitch. link to this video Stevdza San(one of the Better ones) link to this video Start by learning UI Components and Jetpack Compose. https://developer.android.com/develop/ui https://m3.material.io Then the main components of Android( Activities, Services, Content Providers, Broadcast Receivers). When you learn Activities, learn how Intents pass data between activities, study Fragments within Activities and how Lifecycles effect both of these. Know the difference between bound and unbound Services and when to use each. Learn about Inte…

u/GamerFan2012in r/Kotlin • Recommends

On “Trying to learn AndroidDev”

I keep seeing this same question so here's the roadmap I recommend for Android Devs. Philip Lackner link to this video Coding with Mitch. link to this video Stevdza San(one of the Better ones) link to this video Start by learning UI Components and Jetpack Compose. Then the main components of Android( Activities, Services, Content Providers, Broadcast Receivers). https://developer.android.com/guide/components/fundamentals Learn how to use a networking library like Retrofit to communicate with a backend using REST API. link to this video Learn how store that data using Jetpack Room, Jetpack DataStore. link to this video Study Android Jetpack in detail, master it's libraries (Compose, Fragment, Navigation, Paging3, View Pager, Work Ma…