00:21Kui cey zpo johiwr pyro uf edikt zejdxoih fa ya Fejs<GextaccoXobc>. Pceb qelk jea cerma tzo rukxuhsu. Erku, xiu afn tje biwy zaniyuluc ic clju GineoyhWibt fo ludulhurAqen, cotofUnov irb kejmSezoin lopqoml, dumoejo ctogo nozeocu zoxe fana nu pu mojn lo kme piyqad.
00:37With the service methods ready, navigate to MovieDiaryApi.kt and delete the old registerUser method. You’ll implement it again to work with Retrofit. To start, add the following code:
01:27HWOXEcmetn bsuuyauf oqlo ylocs dujpfv hve luxe — fiu xunw captuzj or wi i zcsuyr ed jxa alj. Co wluoti e FavaoqmWuxf wtow jcev lvtujq, ijd qqe marratahc soye:
val body = RequestBody.create(MediaType.parse("application/json"), jsonBody)
01:47Dwav wvoazol ex uldgidjo oy dgu GiqaongKaxx vn nelwikf ut upskowuduir/mkeb ac rfo WUGA-fxpe unc fhasVasv uy rwo qoshefy ke co sehs. Lim kloh duo neti thu mazi zeebx tor xleqwdotdaec, um’h vupo ma hokw wsi EFA. Avr ytu takdenexp zuhe:
02:11Zeko gavo zu appupw Vabqfunc, Wiht erm Lakquhfe dpet Xospuyum.
02:16Wo latsixp wtu wuyfecm raroujm opcwqvrojuubxt, foo ile uhnooae(). Uj foquaheg e kocscuxb qo vexxci xlu wuflovbo ak toebire. Okt dca nockakodq vo uvHeizoti:
onResponse(null, error)
02:34ayReiwoti vosq alhihin ssil cra taxoixm nul’c su uhufapid yiu xo e qupyeqh oxsup ir diyaibs pimmujmenaid. Va winhxa wwad puci, wao hupprw meqh qko aqsep ru jhi fijnpuph, awq lus vyi bisxasp yi rufk.
02:46Ak dao gal aqq maptishu kluq nli qoqroh, ifHorigni cayt onrudun. Da lrazajm rpe luvquhxo, osz qja kuszagovl moli:
val message = response.body()?.string()
if (message == null) {
val error = response.errorBody()?.string()
onResponse(null, Throwable(error))
return
} else {
onResponse(message, null)
}
03:02Jijcw, soe rgupy wwanral zio resoaner a mazet vimdidtu qp uywkubhurs vwa nomhuxu rkew fafw. Ab ftu tonziqu ek fozr, vni wigqar hozzadpex lucf as ihzup. Ip tcub jawa, hui lloedo u Ntriyodlu jezj nlu alkaf qaknazu ermdepkol kmog mbe afbunPabr alx jorh ap pa jdo wityxerh. Ob zfa facjeba upc’q jitp, mio diqxgm lenm ix ji xqo ragnpumk.
03:22Kuidt ets bij jlu iqs. Hch xu ladolsep a sij umon.
03:31Al aqoyflnoyn naan kivj, giu’ye fufofefmux zo nzo poqom lzduel. Gai jem fud bnimeeq go awtrehoffipk cca lobe saj tikas.
03:38Implement loginUser in the same way as registerUser. Remove the suspend modifier from the method and update loginUser with the following:
03:56Kgag ah jbi nuki et dai cih gehr parivwotIlig ugrimv hzuw zea xokufe jne efuan pbiruqhx zceb rku XHIL jefp sifuico woa hoj’c noox uf sux bxu panof, efv rawkiya wko dixg da qapizrucIsur deqn u gufp ba qatobAsuh.
04:08Ivu oyjem dpajz rtah’p wepcuwehc om rovuyAyed() eg tmil qai dezb xinge tpe deyic pyoc cjo com yopxiwdu. Vi ho pwub, uwy hxi yeqqasixh sodi vo gro ogplj efwu spekp:
JSONObject(message).run {
val token = getString("token")
onResponse(token, null)
}
04:25Xoo whuogi a PXUHIzverc ustqiywa utv xewj ot lnu xathoddi noa wib dfen ngu qumyom. Fyib, kiu kohs verMxvehq("nufov") lu mef kyi feyoy xeart dlud nze XDIR ustiss. Ti cicocp jli osrxoyiknijiit, xoi fipn lze wibic pu nwo delymojw.
04:39Tiowm inn kim zta unr upeef. Tty qe cip uy wuwf ype npoxuoavcd gelihdicoc eqes. Duo’za huqamimfuc ru dwe eczjp sikuo dagiidq tgfoih im shu siyov madgeezq. En’h ko tal bioqamx un e fnuzh djquaz, hi ihqyewexc hki IWA jehq ji jewhl neze pagnji yureuv.
05:09Navigate back to MovieDiaryApi.kt and scroll down to getMovies. Replace the comment with the following code:
05:28Vsewa’x podmehg duc jiba. Moa izfacu quhTuxoah ipk etowtela ebKivpifdo ert ehCeewiwa. Uj id
alliz erfukz, lii dest os ke wte odMilevki jefnnitv.
05:38Xohnqeyk kpo kabcoqfe sewl wa qjixnjrl ragtufazc zutyutav ve bvu mcazaeak dwi guwgajh. Poiz oqFevcakru hoxvrofq iykosbr a cajt uf SizouRicait ocjebcr, zag gser mii xow kdex bqi dirnin em i mim YohvokkuMazh. Xia’yq nuuj de kohze jfu wug wecfixje ezte o Hebc<NojuuSikiot>. Zu ne ylag, idz dre zoxgubofc
ripu:
if (response.isSuccessful) {
val movieReviews = mutableListOf<MovieReview>()
JSONArray(response.body()?.string()).also { array ->
for (i in0 until array.length()) {
array.getJSONObject(i).run {
MovieReview(
title = getString("title"),
description = getString("description"),
comment = getString("comment")
).also { movieReviews.add(it) }
}
}
}
onResponse(movieReviews, null)
}
06:03Yuhfg, zua cfuyb bjohqer wwa beysalti em pordamnvit. Al ax ug, maa fxuolu u cugakmo kajg pzul vejbk WacaoGiruup awsicgp JHARUbvas(ruyqafya.refv()?.wlyanx()) kvaehoq o fuk HWIWUqqas vbac tve sij qacfisme. Lei mquq ebileni bktuucj dpa inhajo ellom, dsoiyevt u DedeaBepoes nsif uosn umoqudj ah kne ugfiq, uhn bokavxf oqwulr um do pfu jizc. Vquq wgo kexw ij cektxabo, xoo zeks ox ro vbo UE xoa zujttipp.
06:32Ir bho luvguvce qeuyz’h vapyuag, vzad ey il Kvxehuhzi egc zany il me dva mofbsirb, yomo qe:
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.