Rescuing Old Code with JetPack
summary
Shows concrete steps to modernize legacy Android apps using Jetpack: move business logic from Activities/Fragments into ViewModel to shrink UI and enable testing; replace AsyncTask with Kotlin coroutines/Flow and lifecycleScope (or WorkManager) to prevent leaks/crashes; use Hilt for dependency injection to eliminate global app state and enable mocking; and migrate SharedPreferences to DataStore to keep IO off the UI thread, with before/after code examples and added tests for pure functions.
AI-written summary · about
chapters (14)
- 0:00Rescuing old code
- 2:17Modernize with JetPack
- 3:00Incremental improvements
- 4:04Testing legacy projects
- 6:13Fixing Activity anti-patterns
- 8:43Logic to ViewModel
- 9:06AsyncTask to coroutines
- 10:11Background tasks safely
- 12:22Dialogs with LiveData
- 12:43App architecture anti-patterns
- 13:46Dependency injection
- 14:50SharedPreferences migration
- 15:53Safe refactoring
- 16:35Conclusion
related talks
47mUp to Date? Talking About Your App
01h 13mAccelerating Android Development with Google Jetpack
51mModern Android Development
43mAndroid Jetpack ❤️ Kotlin: On the road to more wholesome APIs
38mPutting a Jetpack on your legacy codebase
58mModern Android Development
01h 13mModern Android development
42mWorking Effectively with (Android) Legacy Code
