Get immediate access to this and over 1,500+ other videos and books.

Boost your skills with a raywenderlich.com Beginner subscription. With over 60+ video courses and our core foundational programming books bundled in one subscription, it’s simply the best investment you can make in your development career.

Challenge: Work with Moshi Parser

The student materials have been reviewed and are updated as of July 2022.

Repeat and practice what you’ve learned about the Moshi parser, and implement another request in which you’ll parse data using Moshi.

Contributors

Heads up... You've reached locked video content where the transcript will be shown as obfuscated text.

You can unlock the rest of this video course, and our entire catalogue of books and videos, with a raywenderlich.com Professional subscription.

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!

implementation 'com.google.code.gson:gson:2.8.6'
class UserProfileResponse(
    @field:Json(name = "email") val email: String?,
    @field:Json(name = "name") val name: String?)
fun getMyProfile(@Header("Authorization") token: String): Call<UserProfileResponse>

Reviews

Comments