catholicla.blogg.se

Retrofit gradle
Retrofit gradle








retrofit gradle

Retrofit 2 Retrofit retrofit = new Retrofit.Builder() setConverter() method to override the default converter (GSON). Just pass the new SimpleXMLConverter() constructor to the. setClient(new OkClient(new OkHttpClient()) Retrofit 1.9 RestAdapter adapter = new RestAdapter.Builder() Now, we have to define the SimpleXMLConverter as converter for the RestAdapter ( Retrofit in Retrofit 2). Afterwards, proceed with the next steps described in the section below :) XMLConverter feat.

retrofit gradle

Once you added the dependency for the SimpleXML converter to your adle file, sync the project and wait for Android Studio to finish the process. Here we go, define the dependency in your adle.Ĭompile ':converter-simplexml:1.9.0'Ĭompile '2:converter-simplexml:2.5.0' Have a look at our previous post about how to create or define your custom response converter if you want to know more about existing converters for Retrofit.

retrofit gradle

The Retrofit project already has an XML converter available which you need to add to your project as a peer-dependency. Define Gradle Dependencyįirst stop is the adle file. Here, we’ll show you how to integrate an XML converter to map HTTP responses from XML to Java objects. If not, please have a look at the getting started post in this series. We assume you’re familiar with the basics of Retrofit and you know how to configure Retrofits RestAdapter ( Retrofit in Retrofit 2).










Retrofit gradle