We're sorry but this page doesn't work properly without JavaScript enabled. Please enable it to continue.
Feedback

Migrating from Autovalue to Kotlin Data Classes

Formal Metadata

Title
Migrating from Autovalue to Kotlin Data Classes
Title of Series
Number of Parts
90
Author
License
CC Attribution 3.0 Unported:
You are free to use, adapt and copy, distribute and transmit the work or content in adapted or unchanged form for any legal purpose as long as the work is attributed to the author in the manner specified by the author or licensor.
Identifiers
Publisher
Release Date
Language

Content Metadata

Subject Area
Genre
Abstract
Languages Talk, Intermediate AutoValue is a powerful tool provided by Google to generate Java immutable value classes. If you are migrating your project to Kotlin, data classes are the most direct way to replace it while keeping the same features. There are however trade-offs to take into account. In this talk we will introduce how we migrated our project from AutoValue to Kotlin data classes and how we dealt with the issues we encountered along the way. We will also discuss the advantages and disadvantages of each approach in terms of build time, apk size, method count and serialization time. After this introduction, we will deep dive into two topics: First, we will look into different serialization strategies available and how they perform. We will look into Gson, Moshi and Kotlinx.serialization libraries and explore their trade-offs when choosing one. Second, we will explain how we built an IntelliJ/Android Studio plugin to help us automate the conversion from AutoValue to Kotlin Data Classes. We will explain how plugins work and how you can also develop one to help automate repetitive IDE-related tasks.