mobile-android-kotlin

Implement Kotlin Android UI with lifecycle-aware coroutines and StateFlow/SharedFlow.

6|Updated Apr 24, 2026
One-click install
npx skills add https://github.com/lookatitude/guild --skill mobile-android-kotlin
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: mobile-android-kotlin
Source: https://github.com/lookatitude/guild/tree/main/skills/specialists/mobile-android-kotlin
Command: npx skills add https://github.com/lookatitude/guild --skill mobile-android-kotlin

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps Android developers implement UI and features in Kotlin with lifecycle-aware coroutines, clean architecture, and safe context handling, reducing leaks and boilerplate.

Core Features & Use Cases

  • Structured concurrency and lifecycle awareness using viewModelScope, lifecycleScope, and StateFlow/SharedFlow for reliable UI state and events.
  • Support for Jetpack Compose or View-based UI depending on interoperability requirements, with guidance on error handling and performance.
  • Gradle/manifest notes and guidance for Kotlin code organization across Android modules, ensuring testability and maintainability.

Quick Start

Create an idiomatic Android screen in Kotlin that respects lifecycle and uses Jetpack Compose or the View system as appropriate.

Frequently Asked Questions about mobile-android-kotlin

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I implement lifecycle-aware coroutines in Android Kotlin to prevent activity leaks?

Lifecycle-aware coroutines prevent activity leaks by binding structured concurrency to viewModelScope or lifecycleScope. This enforces safe scopes using SupervisorJob and manages UI state with StateFlow, ensuring background tasks cancel appropriately when Android components destroy.

What is the best way to manage UI state in Kotlin using StateFlow and SharedFlow?

StateFlow manages UI state while SharedFlow handles events in Kotlin Android development. This approach separates persistent screen state from one-time actions, providing a reactive lifecycle-safe model that feeds Jetpack Compose or View-based UIs without leaking context.

Does this approach support building UI with both Jetpack Compose and the traditional View system?

Yes, it supports Jetpack Compose and the View system for Android UI implementation. It provides guidance on interoperability requirements, ensuring idiomatic Kotlin code organization across Android modules while maintaining clean architecture and testability regardless of the UI framework chosen.

How do I structure an Android Kotlin app for clean architecture and testability?

Structure Android Kotlin apps for clean architecture by enforcing lifecycle-aware scopes and separating UI state with StateFlow. This Skill guides Gradle and manifest configuration alongside Kotlin code organization across Android modules, reducing boilerplate and ensuring maintainability and testability.

Why do my Android coroutines crash when the screen closes, and how do I fix it?

Android coroutines crash when screens close if scopes lack lifecycle awareness. Fix this by using viewModelScope or lifecycleScope with SupervisorJob for structured concurrency, ensuring proper cancellation of StateFlow and SharedFlow streams and avoiding activity leaks during configuration changes.