

Other date fields, such as day-of-year,ĭay-of-week and week-of-year, can also be accessed.įor example, the value "2nd October 2007" can be stored in a LocalDate. LocalDate is an immutable date-time object that represents a date, Then on top of your app-level adle file, add the plugin.A date without a time-zone in the ISO-8601 calendar system, classpath ":kotlin-serialization:$kotlin_version"

In your project-level adle file, add the classpath dependency. I’ll show you my Gradle configuration below, but if you’re reading this and are already more familiar with Kotlinx Serialization than me and can suggest the correct way to make it work with Jake Wharton’s library, please stick it down on the comments. So the only solution that worked for me was to use the still beta version 0.20.0 of the Kotlinx Serialization library. Importing the library into Gradle was a nightmare on my new Android project running Gradle 6.7, also thanks in part to duplicate class errors with Jake Wharton’s Retrofit Kotlinx Serialization Converter which I’m also using because you know, Retrofit. While that may be the case in pure Kotlin or Kotlin Multiplatform projects, I wouldn’t be so sure for Android. In fact, the first stable version of the library 1.0 was released just last month!Īnd it is now viable for use in production code!…. Kotlinx Serialization isn’t a name I’ve heard until quite recently. Of course, I needed to learn it first before benchmarking it against Jackson-Kotlin, so hey here’s another Getting Started post. I had only come across this for the first time in my initial research about the JSON Parsers about a month ago. And from the suggestions of my fellow Reddit guys in r/androiddev, why not benchmark Kotlinx Serialization too? However, what I didn’t test was the Jackson Kotlin module. If you’re interested, read the full article below:īenchmarking Gson vs Jackson vs Moshi 2020 A couple weeks ago, I benchmarked Gson, Jackson, and Moshi against each other.
