Android Programming: The Big Nerd Ranch Guide, 5th Edition
by Bryan Sills, Brian Gardner, Kristin Marsicano, Chris Stewart
Networking Basics with Retrofit
Although it is not developed by Google, Retrofit is the de facto official way to communicate with an HTTP API on Android. Retrofit is an open-source library created and maintained by Square (square.github.io/retrofit). It is highly configurable and extendable, allowing you to easily and safely communicate with a remote web server. It is organized into components that serve a specific purpose, and you can swap out individual components as you need.
Retrofit is meant to define the contracts for many different types of network requests. Similar to using the Room database library, you write an interface with annotated instance methods, and Retrofit creates the implementation. Under the hood, Retrofit’s ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access