AndroidX Lifecycle's Path to Multiplatform
summary
AndroidX Lifecycle moves to Kotlin Multiplatform by extracting shared logic (a new viewModelProviderImplementation) while keeping Android-only constructors and factories for binary compatibility, introduced a new create method to avoid breaking synthetic @JvmOverloads constructors, and duplicates get/factory signatures to bridge java.lang.Class vs KClass. CI uses metalava and the Kotlin binary compatibility validator to catch API changes. Timeline runs Jan–May 2024 with Navigation KMP alpha unblocked; kotlin.reflect.full is avoided and custom expect/actual sync and scope fallbacks are implemented and tested.
AI-written summary · about
chapters (15)
- 0:00AndroidX Lifecycle KMP intro
- 1:30KMP support levels
- 2:55Lifecycle KMP stable timeline
- 3:37Lifecycle API challenges
- 7:16ViewModelProvider migration issues
- 10:48Public API changes in KMP
- 12:11Java type compatibility
- 13:36Reflection and platform APIs
- 15:44Expect/actual for ViewModelProvider
- 18:55ViewModelProvider strategy
- 20:59ViewModel addClosable migration
- 22:00ViewModel sync in KMP
- 24:52Sync APIs per platform
- 25:54ViewModelScope and dispatchers
- 27:42Key takeaways
related talks
39mAndroidX Lifecycle's Path To Multiplatform
41mApollo-Android: a Journey to Kotlin Multiplatform
52mIntroducing Kotlin Multiplatform in an existing project
43mKotlin Multiplatform at Stable and Beyond
36mIntroducing Kotlin Multiplatform in an existing project
26mKotlin Multiplatform in an MVVM World
42mApollo-Android: a Journey to Kotlin Multiplatform
38mBuild a Multiplatform Future with Kotlin
