Quick Retrofit Overview
Image From Documentation

Quick Retrofit Overview

Retrofit establishes a connection with RESTful web services. It communicates with the backend. It creates URI's for the web services based on the parameters we pass to it.

Retrofit needs two things to build a web services API, the first one is?base URI?and the second is?Converter Factory.

WHY DO WE NEED A CONVERTER FACTORY?

When retrofit sends the request to the server with the help of base URI then the server sends back the response in JSON or XML most of the time. After getting the response, retrofit does not know what to do with that response, here comes the Converter Factory. Converter Factory tells the retrofit what to do with the response (JSON/XML) whether to convert it into a string or in a Kotlin/Java Objects.

Request -> Remote Server -> Response(JSON) -> Converter Factory -> Our App

This was a quick overview of Retrofit. Let me know your thoughts on Retrofit.


要查看或添加评论,请登录

Shoaib K.的更多文章

  • Room Database Library

    Room Database Library

    Room library is an abstraction layer on top of SQLite. Instead of using SQLite directly, Room simplifies the chores of…

  • 12 Github Repositories that will make you a good Android developer.

    12 Github Repositories that will make you a good Android developer.

    Google I/O Android App Jetpack Compose Samples by Android Team Android Sunflower, an app to illustrate Android…

    1 条评论

社区洞察

其他会员也浏览了