Android Networking: Fundamentals
Sep 6 2022 · Kotlin 1.6, Android 12, Android Studio Chipmunk | 2021.2.1 Patch 1
Part 2: Implement Retrofit Basics
17. Challenge: Work with Moshi Parser
Notes: 17. Challenge: Work with Moshi Parser
The student materials have been reviewed and are updated as of July 2022.
Heads up... You've reached locked video content where the transcript will be shown astext.
In this challenge, you’ll finish off learning how to work with Moshi, by implementing the last request that’s using GSON, using Moshi. You’ll also remove Gson, and the need for manual parsing, to rely on Retrofit entirely! :] That’s it! Now pause the video, and solve the challenge! Then once you’re done, unpause the video, and compare the two solutions!
class UserProfileResponse( @field:Json(name = "email") val email: String?, @field:Json(name = "name") val name: String?)
fun getMyProfile(@Header("Authorization") token: String): Call<UserProfileResponse>