Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

README.md

Gson converter

Модуль для парсинга json ответов сервера

Использование

  1. Добавить ResponseTypeAdapterFactory в билдер gson`a
    GsonBuilder()
        .registerTypeAdapterFactory(responseTypeAdapterFactory)
        .create()
    
  2. Добавить gson в билдер ретрофита
    Retrofit.Builder()
        .client(okHttpClient)
        .baseUrl(apiUrl.toString())
        .addConverterFactory(GsonConverterFactory.create(gson))
        .addCallAdapterFactory(callAdapterFactory)
        .build()
    

Пример использования в приложении

Подключение

Gradle:

    implementation "ru.surfstudio.android:converter-gson:X.X.X"