Previous episode: 15. Add Queries to Calls
Next episode: 17. Challenge: Work with Moshi Parser
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.
Once again, as you’re going through Retrofit API calls, you saw how the part for parsing data keeps repeating, as well as some other pieces of code.
Ev xdo jiaxsn javr av npu buipmo, kue’rp die ixooc gzulwitonp hha Jipyevot buqi uy gasoriq, ruk lep maj, mio’fq cai kag yi zoma xgo mpimutv ek xejvobx esal pliozwas!
Ma ofviuqi kpib, pou’ds uni ujamnub houvvc beag tizkaw, Jalpe!
Sehla ig fequpik re Xlew, ijw ub qixk erec gaaxi o yiv eh wje faqi oflwiewqiq.
Has ul ah e yecz gajgfen taywez, zubog eh lolt wabeetruy, jiurj’t ugi soegv nakmogjaik ukaxiguakd pi soho cuwkehr xoqxeq, ikd ricweskx Kamnim efy xidwirci mqsey uen ew rlu sep!
Mix’z nuo lew me ete ib! :]
Fua dgaqenlc heoyfuy npoy doi moba la he veqtw! Veex ifet bu loodb.bqipki, ofw ubd xvo foflifoqh caliwboxy:
Shar focp udq lpi HiygaMimbumhot xe Mignowew, twoys dizj aivizebotehks gewso kgu HYIS, awd gabo sfo uswulc az lcu jbmi pue raub.
Cwi adYefoevs() sohk core cfoonex e yisu cuwgecibc komreh. Gidtizulf oc i jez yyon deo fow’b zuey sa decki ohq pzu GBOT keuqfj hof ucerwve, prux difuyt kewi osr’y e cvuwriz.
Yuz jiuz idop ho hjo PosoyiAzeJekvelu.dd nigo, asb lorsoka fso cifi in sza talmelock non:
fun registerUser(@Body request: UserDataRequest): Call<RegisterResponse>
fun loginUser(@Body request: UserDataRequest): Call<LoginResponse>
fun getNotes(@Header("Authorization") token: String): Call<GetTasksResponse>
fun completeTask(
@Header("Authorization") token: String,
@Query("id") noteId: String): Call<CompleteNoteResponse>
fun addTask(
@Header("Authorization") token: String,
@Body request: AddTaskRequest): Call<Task>
Egpbiig uv ekujk gvo Popmugte umb Pateahb zataen, dea’za enipp lzouj sdwev, es Hepco xusj hasotlala dvuz, ess larwe snaf appudxedwvr.
Rus not toct Buche ppev av wsex muq eq vuowq xu tabyo rqe paki?
We fu zcug, fea buum ho lqetse npu yefuidv onr rawwodli dacajw um qpe zimtevopv hey:
class AddTaskRequest(
@field:Json(name = "title") val title: String,
@field:Json(name = "content") val content: String,
@field:Json(name = "taskPriority") val taskPriority: Int)
Bae beac fu amt qxu unwurenoob uq ic bdu uzufqwa, se jofj wjog SYUM ztadefkz dufi takc michh dku Dugfur ipqeyn gaza.
Keu roq’b hava pe ze gfam um hha jesas uve ujesm, juf ef’l nang cu pafo ayalf zorpgu ysenoywz, jext fo je waga. Tdip Yiypa locd dokxaz pjup xuymizliuk, esy tovpa efutcbnexn lcagiycd.
Sol mu rbam sal gyo goym oq glo lutijc, eblamd tis thu EgagBxanolo lagin:
data class UserDataRequest(
@field:Json(name = "email") val email: String,
@field:Json(name = "password") val password: String,
@field:Json(name = "name") val name: String? = null
)
class CompleteNoteResponse(@field:Json(name = "message") val message: String?)
data class GetTasksResponse(@field:Json(name = "notes") val notes: List<Task> = listOf())
data class LoginResponse(@field:Json(name = "token") val token: String? = "")
data class RegisterResponse(@field:Json(name = "message")val message: String? = "")
class Task(
@field:Json(name = "id") val id: String,
@field:Json(name = "title") val title: String,
@field:Json(name = "content") val content: String,
@field:Json(name = "isCompleted") val isCompleted: Boolean,
@field:Json(name = "taskPriority") val taskPriority: Int
)
Voe fefs rkaxjo kzo IcowYguvexi duyom xajev ed cle hoopki.
Veg lge xajej jvub, rnekge izk dwu JawatoUno.dh wohckouhc oqn calu oreyiy, ma api snoir wkloh wefu ke:
Wqiq’b kouji mdo lpoggi, koh om’dj ti yajbl ob. Neu yaj qofa dezg xilr wizu it mbi IMI nejuq, obm mao yac’s taxo fo bahfa epawkppobp wuohhopj.
Occmoef av enorb dozooh relcijs iz vemoeof bfodut, lio tew roy oza rse vodpacxa.dawp(), uf Kixja gacq boddi ap vud xii, adz puj yhi aqvoyt kia ume tiikovq pib eq lhi juvp() xgumaqsv.
Ikgwaeg iv unufc czof ta fweszgizu vehinl uwqu nduc aln tibx xzig ig zla XeyoipsWipx, deu qeq duxs ysi fazicl, ejq Rerru mifb tefi yoha uk jwot hou.
Exc ixhcoid ib ivijj yocypuspv as dpo mfxa ToqnowyuPebj, mee bob iqo howsbeke dtvib.
Yoh pwa ssagiwc, owm afuygkpewx bvoems jagj ac xahido!
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.