Retrofit 2 – Handle Connection Timeout Exception
Learn to configure timeouts in android apps using retrofit 2 and OkHttp library. We will learn to configure default timeouts and custom connection timeouts in this tutorial.
Learn to configure timeouts in android apps using retrofit 2 and OkHttp library. We will learn to configure default timeouts and custom connection timeouts in this tutorial.
In this Retrofit2 tutorial, we will learn to parse RSS feeds in an Android application using Retrofit2 and the SimpleXmlConverterFactory.
Learn to parse a sitemap in an Android app using Retrofit2, which uses XML parsing with a simple XML converter dependency. Here’s a Retrofit sitemap reader example.
Learn to execute synchronous and asynchronous calls (i.e. blocking and non-blocking calls) in an android app using Retrofit 2 and OkHttp library.
Though we can easily create Retrofit instances on demand for different client in place, having a dedicated factory method or service generator method is definitely desirable. In this service generator, we can have centralized place to add/modify the authentication, logging and error handling logic. 1. Retrofit service generator A service …
Learn to add logging support in Retrofit 2 using HttpLoggingInterceptor and OkHttpClient APIs. In Retrofit 2, all network operations are performed via OkHttp library. OkHttp provides HttpLoggingInterceptor which logs HTTP request and response data. An example to add HttpLoggingInterceptor to OkHttpClient. 1. Dependency 2. Create and add HttpLoggingInterceptor we can …
Retrofit.Builder class uses the Builder API to allow defining the URL end point for the HTTP operations and finally build a new Retrofit instance.
Learn to perform requests with single, multiple and even optional query parameters and path parameters using @Query and @Path annotations in Retrofit 2.
In this Retrofit 2 tutorial, we will learn the basics of Retrofit and then we will create a declarative REST client for Android for executing HTTP requests against a REST API. 1. What is Retrofit? Retrofit was developed by Square and in its documentation, it is a type-safe REST client …
HowToDoInJava provides tutorials and how-to guides on Java and related technologies.
It also shares the best practices, algorithms & solutions and frequently asked interview questions.