Easy Retrofit 2 Tutorial in Android Studio using Kotlin & Coroutines

preview_player
Показать описание
Hey guys! So in this video I'll show you how to create this very basic app using Retrofit2, and hopefully that gives you a basic idea on how to use it. Otherwise in the near future I'll show you how to get a list of objects so you can create a nice app with a recycler view that takes data from the internet!

All you need for this app can be found down below:

​​​​
Рекомендации по теме
Комментарии
Автор

Very good explained. There are a lot of 2-3 hours tutorials which contains a lot of irrelevant information combined with an incomplete example. Continue with that sir! I am a subscriber now, and have bookmarked some of your videos because those helps me in my everyday work

karateswe
Автор

Thank you SIR for a very clear tutorial. It works and killed the headaches I had trying to figuring out how Retrofit works in other tutorials. Rainbow and cookies rain on you ^^

Sophie-jpnd
Автор

Thank you, I have learnt a lot from your videos!

I just noticed something that you wrapped the interface method returns with Call<>. But since you are using a version of Retrofit greater than 2.6.0, you can use the data class as the return type. For this to work, you would have to add the 'suspend' keyword before the fun methods in the api interface.

This will enable you to use coroutines automatically without worrying about the context changes as Retrofit is already configured to use a background worker thread for network calls.

Also that plugin is such a godsend, I was using jsonschema2pojo before, but this is much cleaner! :D

dipanzan
Автор

Thanks palace but, how did u call textViews from layout without using binding?

_Privet_Zdarova
Автор

I just watched 1 video and now i love you man... you are the best programmer i've ever seen; please tell me how i can be like you?

Rotatesim
Автор

What i need to do if i have boolean value in json, when i want assign json value to text view value

Andrey-riuo
Автор

i saw so many videos, finally this one helped me fetched data. im just having confusion havin gparameters in API post? do you have custom api calls?

nnasim
Автор

Nice video It was helpful, Please can you create a video like this adding room database to it?

kehindeonyekuwuluje
Автор

Hello, can u tell me what code is to implement a button instead of layout pls?I hope u will help me.Thanks

Randomuserb
Автор

hi
i can't connect to url of api
can you help me? please

tuanphongang
Автор

Can you make a similar retrofit app with Recycler view to display list of data and use Lazy Loading which displays data in parts?

arpitgupta
Автор

I mean, i want to press button and get random fact

Randomuserb
Автор

I am trying to use this on reddit API n its not working, ,any suggestion

atharvadawande
Автор

how about POST request using formurlencoded?

kannapipa
Автор

Thank you for the video, thats really nice. Let me give you advice to dont speak so fast next time:)

ghglgou
Автор

hello nice job man !!, can you create retrofit kotlin and php using of course *phpstorm* please ! without using java

youssefmansour