In this recipe, we are going to make use of the @Parcelize annotation to simplify the implementation of the Android Parcelable interface, allowing us to serialize objects efficiently. @Parcelize is available in the Kotlin Android Extensions plugin and provides automatic code-generation for Kotlin classes that implement the Parcelable interface.
Easy class serialization on Android using the @Parcelize annotation
Getting ready
We are going to implement the Android instrumented test case in order to verify the effect of a class serialization and deserialization in action. To make use of the Android KTX library, we need to add it to the project dependencies. In our case, we will need it in the android-test module. We can add it...