Kids, Play Nice! - Writing With Kotlin-Java Interop
summary
Nexmo’s Kotlin-Java interop experience delivers ten concrete fixes: annotate nullability to avoid platform types, prefer bean-style getters, use @JvmOverloads and @JvmName/@JvmStatic/@JvmField to give Java sane overloads and names, expose SAM interfaces or Java-written functional interfaces to keep lambdas, put the lambda parameter last, avoid returning Unit, and be cautious because sealed classes don’t map cleanly to Java. Use Android Studio’s Kotlin bytecode → decompile to Java and lint checks and validate by writing both Java and Kotlin client apps.
AI-written summary · about
chapters (10)
- 0:00Introduction to Kotlin-Java interop
- 2:33Why Kotlin-Java interop matters
- 4:40How JVM handles Kotlin and Java
- 8:28Top 10 tips for interop
- 17:44Method naming and operators
- 25:45Lambda arguments and interfaces
- 27:53Companion objects and files
- 31:46Sealed classes and open classes
- 33:11Bonus tips and testing
- 36:24Q&A and closing
related talks
39mTeach Kotlin to play well with Java - Optimization tips for Interoperability
42mIdiomatic Interop with Kotlin
43mIdiomatic Interop
41mKotlin: Facts You Might Not Know
49mKotlin: the swift of Android
36mKotlin, Beyond the Basics
41m10 Tips to Make Libraries Kotlin-Friendly
50mKotlin is as awesome as you've heard. Here's why.
