Skip to content

Latest commit

 

History

History
executable file
·
29 lines (25 loc) · 925 Bytes

File metadata and controls

executable file
·
29 lines (25 loc) · 925 Bytes

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"