Skip to content
cccskills
FreePublished on GitHub

android

Provides expert knowledge for building modern native Android apps using Kotlin, Jetpack Compose, Material Design 3, MVI architecture, Hilt dependency injection, and Media3/ExoPlayer.

The English summary is being prepared. Showing the original description.

See how to install

Files included (1)

  • SKILL.md5.0 KB

SKILL.md (original)

Review the instructions the agent will receive before you install.

Android + Kotlin (Jetpack Compose & Media3)

This playbook defines the architecture, UI design system, performance guidelines, and testing strategy for native Android applications.

android-ui-design owns specialized Jetpack Compose phone UI/UX design, implementation, review, and audit guidance. This skill remains the general guide for architecture, Hilt dependency injection, Media3, performance, and testing.


1. Lead Architect & Modularization

Architecture (MVI / MVVM with Clean Architecture)

  • Prefer MVI (Model-View-Intent) for state management. Ensure a strict unidirectional data flow:
    • UiState: Single source of truth for the UI state.
    • UiIntent: Actions initiated by the user or system.
    • UiEffect: One-time events (navigation, toasts, snackbars).
  • Separate the project into clean logical modules:
    • app: Application entry point, launcher activity, global dependency injection configuration.
    • core: Shared resources, network layer, media playback logic (ExoPlayer/Media3), storage.
    • feature: Individual business features (isolated and independent of other features).

Dependency Injection (Hilt)

  • Annotate the Application class with @HiltAndroidApp.
  • Annotate Activities and Fragments with @AndroidEntryPoint.
  • Use constructor injection for ViewModels with @HiltViewModel.

2. Jetpack Compose UI/UX

Recomposition & State Management

  • Consume StateFlow from ViewModels safely using collectAsStateWithLifecycle() to respect the activity lifecycle.
  • Keep data models immutable. Mark configuration classes with @Immutable or @Stable to prevent redundant recompositions.
  • Use contentType and key in LazyColumn and LazyRow to optimize item recycling and rendering performance.
  • Avoid fixed hardcoded margins. Apply WindowInsets to support modern edge-to-edge screens.

3. Performance & Multimedia (Media3 / ExoPlayer)

Playback & Services

  • Run ExoPlayer / Media3 inside a robust Foreground Service (using MediaSessionService) to ensure playback continues when the app is in the background.
  • Clean up resources: release player instances in onDestroy or when the service is stopped.
  • Control wake locks strictly to avoid draining the user's battery when playback is paused.

Kotlin Coroutines & Threading

  • Always inject CoroutineDispatcher instances instead of hardcoding them:
    • Dispatchers.IO: Database access, network operations, file reading.
    • Dispatchers.Default: CPU-intensive operations (parsing JSON, filtering large lists).
    • Dispatchers.Main: UI modifications and light interactions.

R8 & Resource Optimization

  • Enable shrinking and obfuscation in production builds:
    • isMinifyEnabled = true
    • isShrinkResources = true
  • Convert all static images to the modern WebP format to minimize the application binary size.

4. Quality Assurance & Automated Testing

Unit Testing

  • Use JUnit 5 and MockK for mocking dependencies.
  • Test ViewModels and Reducers by asserting StateFlow updates. Use Turbine to easily test Kotlin Flows.
  • Mock all multimedia/ExoPlayer components to avoid loading actual audio/video resources in unit tests.

UI Testing

  • Create UI tests using Compose test rules: createComposeRule() or createAndroidComposeRule<MainActivity>().
  • Assert correct rendering, visibility states, and user interactions without executing real network calls.

5. Key Gradle & ADB Commands

Use these commands for building, checking code style, running tests, and profiling performance:

CommandAction
./gradlew initInitialize a new Gradle project structure.
./gradlew app:dependenciesList all dependencies of the application module.
./gradlew assembleDebugValidate compilation and generate debug APK.
./gradlew ktlintCheckRun KtLint check to enforce Kotlin style guidelines.
./gradlew lintDebugRun Android Lint tool to inspect code quality and UI issues.
./gradlew testDebugUnitTestRun unit tests for debug build variant.
./gradlew connectedAndroidTestRun instrumented UI tests on connected emulator or device.
./gradlew assembleReleaseGenerate release build variant with R8 optimizations.
adb shell dumpsys batterystatsProfile system battery consumption metrics.
adb shell am dumpheap <package> heap.hprofDump application heap memory file for profiling.

Reviews

No reviews yet. Tell others what you thought.

Comments

No login needed. Share how it worked for you, ask a question, or note where it did not run.

No comments yet. Be the first to write one.

Comments are published right away. Do not include personal information such as email addresses or phone numbers. Up to 2 URLs.

0 / 1,000 characters

This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.

More skills from this repository

Use when adding monitoring, metrics, logging, or tracing to Spring AI or LLM integration code. Covers token tracking, latency measurement, cost estimation, and prompt/response logging. Use when user mentions AI monitoring, token costs, or LLM observability.

The English summary is being prepared. Showing the original description.

lgzarturo/springboot-course3Updated Oct 17, 2026

Design, implement, review, and audit Android Jetpack Compose UI/UX for phone interfaces. Use when a request concerns concrete Compose layout, components, interaction, accessibility, or visual behavior. Do not activate for framework or dependency presence alone; non-UI Android work is excluded.

The English summary is being prepared. Showing the original description.

lgzarturo/springboot-course3Updated Oct 17, 2026

Provides expert knowledge for designing, implementing, and managing REST API versioning strategies with deprecation workflows.

The English summary is being prepared. Showing the original description.

lgzarturo/springboot-course3Updated Oct 17, 2026

astro

Free

Provides expert knowledge for building Astro 5+ sites with Islands Architecture, Content Collections, TypeScript, and performance-first rendering strategies.

The English summary is being prepared. Showing the original description.

lgzarturo/springboot-course3Updated Oct 17, 2026

Audits token storage mechanisms to prevent XSS-based JWT theft.

The English summary is being prepared. Showing the original description.

lgzarturo/springboot-course3Updated Oct 17, 2026

Provides patterns to configure AWS RDS (Aurora, MySQL, PostgreSQL) with Spring Boot applications. Configures HikariCP connection pools, implements read/write splitting, sets up IAM database authentication, enables SSL connections, and integrates with AWS Secrets Manager. Use when setting up RDS connections in Spring Boot, configuring connection pooling, or managing database credentials securely.

The English summary is being prepared. Showing the original description.

lgzarturo/springboot-course3Updated Oct 17, 2026

See all skills by lgzarturo

Report a problem with this skill