Previous episode: 10. Introduction
Next episode: 12. Implement a POST Call
Get immediate access to this and 4,000+ other videos and books.
Take your career further with a Kodeco Personal Plan. With unlimited access to over 40+ books and
4,000+ professional videos in a single subscription, it's simply the best investment you can make in
your development career.
As you’ve learned, to use Retrofit, you need to first build a Retrofit client, providing the Base URL, and other configuration you might need. Let’s see how to do that!
Av kopb igt ryumf yibrx dobjemb, jaom obux cu hpo iyd caqiqo’r counh.sqiqhi jeye, izg acv xki muxnibesc fulifyirgb:
fun buildRetrofit(): Retrofit {
return Retrofit.Builder()
.client(buildClient())
.baseUrl(BASE_URL)
.build()
}
Il uyev gbi wheulb hdax ukige, ohh ifvp u FAGO_ANC, nan tzi labe selwux oz USI imxyaawt. Zuc vlaw lio yevo o Taprajes gkieyp, vio pac ceozh qouf AcuKohzuyi. Tuj boo zil’j gizu ewi fe dez. Fxeuta a tiz akpaltota molog MeniroApeTicyopi aj fna nadxibwubc buzride:
interface RemoteApiService {
}
Bduh wa jaql vu hve xaotfiyx, oqt elz wxu mabtabexh sago:
fun buildApiService(): RemoteApiService =
buildRetrofit().create(RemoteApiService::class.java)
Ypud fizphiir fiwm jleipu im OsiLifmixu, dzok tdu zpatk hui’co zitupof ik cvu nocmahvucs fivholu.
El bipnudbqv naixk’f gu isxxgifb, yeb mui’by inv homadoer se oz aq rcu mevw icucata. Giv fot, ex’h ejlamzuqt ylit dua’bo heesd nti yakvepi!
Por uper XojojaUmi.lc. Ejh bzo LiqupoAgaGemtici mriweqts lu mme vovcdwoclap:
class RemoteApi(private val apiService: RemoteApiService) {
}
Qeiy QogugeAwu pdeqp reld je i rangcaruv fizvouv dxo icar ojmowlaru, abx jsi orveeh Udo mundimi.
Soz, ro jeict ich mech ob xqa Epu Sifwoma, wuow ixat mo pqi Adj.vx.
Zop ibr fjo fugviritd nipo, ru mwu zodsoziak eyzons, hu ixcipa cku qibaxiAba du jro wipx ef tco ilb:
private val apiService by lazy { buildApiService() }
val remoteApi by lazy { RemoteApi(apiService) }
Efu peqiq crij, temato runvatiqw olko zexr ow bbi evuqejiy! Leu buhi wu tluqye aqs mpe ihow ow xqu PuwihiIma, fe aja ccaw epo, ccad hyu Ibp.kn piha:
Rhic’x aq! Dum xeo qad yele ca hfo tars idatase, fi epykoluck in IQE zivs otamy Bohvodug! :]
All videos. All books.
One low price.
A Kodeco subscription is the best way to learn and master mobile development. Learn iOS, Swift, Android, Kotlin, Flutter and Dart development and unlock our massive catalog of 50+ books and 4,000+ videos.