What problem does it solve?
This Skill provides a comprehensive set of rules and best practices for writing robust, efficient, and maintainable Kotlin Coroutines code specifically for Android development, ensuring structured concurrency and lifecycle safety.
Core Features & Use Cases
- Structured Concurrency: Enforces proper scope management and cancellation.
- Lifecycle Integration: Ensures coroutines respect Android component lifecycles.
- Reactive Streams: Guides the use of Kotlin Flows for asynchronous data streams.
- Error Handling: Implements robust error handling strategies for coroutines.
- Use Case: When building an Android app that fetches data from a network API and displays it in a ViewModel, this skill ensures the data fetching is done off the main thread, handles potential errors gracefully, and automatically cancels the operation when the UI is no longer visible.
Quick Start
Use the android-coroutines skill to implement a main-safe suspend function for fetching user data in a repository.