Java Android Workflow
Purpose
Preserve Java Android codebases and make Kotlin/Java boundaries explicit when Android modules are mixed-language.
The practical decision is whether to stay Java-only, add Kotlin interop carefully, or route implementation to Kotlin-first guidance without forcing a migration.
Source Check
Use repo-local Java, Kotlin, Gradle, and Android files first. Use Dash.app Java or Gradle docsets opportunistically for installed local reference. Use official documentation as authority for Android-specific APIs, Kotlin Java interop, AndroidX behavior, and version-sensitive rules:
Translate documentation into concrete API, annotation, source-set, or validation choices.
Inspection Workflow
- Inspect source ownership:
src/main/java
src/main/kotlin
- generated sources
- public Android library APIs
- Java callers of Kotlin code and Kotlin callers of Java code
- Identify interop boundaries:
- nullability annotations
@JvmName, @JvmOverloads, @JvmStatic, @JvmField, or @Throws
- SAM conversions and functional interfaces
- checked exceptions and callback APIs
- data classes, sealed classes, objects, companion objects, and generated bytecode as seen from Java
- Preserve Java-only projects:
- keep Java examples and implementation idiomatic for the existing codebase
- do not add Kotlin plugin or Kotlin sources without user approval
- keep AndroidX and Java language level aligned with repo configuration
- Maintain mixed projects:
- keep public APIs friendly from both languages when they already cross the boundary
- use annotations for nullability and threading where the repo already does
- keep generated binding, Room, Hilt, KSP, KAPT, or annotation processing behavior explicit
- Validate:
- compile or assemble the affected module
- run unit tests that exercise the Java/Kotlin boundary
- run lint when annotations, threading, lifecycle, resources, or Android APIs changed
Implementation Guidance
- Prefer Java implementation in Java-dominant Android modules.
- Prefer Kotlin implementation in Kotlin-dominant modules unless Java API compatibility owns the change.
- Keep Android callbacks, listeners, and lifecycle methods readable from the language that owns the file.
- Preserve binary and source compatibility for Android libraries unless the user approves a breaking change.
- Document migration decisions in repo-facing docs only when the task changes project policy.
Output Shape
Return:
Language owner: Java-only, Kotlin-first, mixed, or migration decision needed.
Interop boundary: APIs, annotations, generated code, callbacks, nullability, or bytecode concerns.
Affected modules: module, source set, public APIs, tests, and generated sources.
Validation path: exact Gradle commands.
Risk: migration, binary compatibility, annotation processing, nullability, or public API risk.
Guardrails
- Do not rewrite Java Android code to Kotlin just because Kotlin is preferred for new Android work.
- Do not add Kotlin to a Java-only project without an explicit user decision.
- Do not expose awkward Kotlin APIs to Java callers when public interop matters.
- Do not drop nullability, threading, or lifecycle annotations casually.
- Do not route backend Java services through this skill.
1---2name: java-android-workflow3description: Maintain Java-only Android projects and Kotlin/Java interoperability inside Android apps or libraries, including Java source sets, AndroidX Java APIs, annotations, nullability, SAM boundaries, generated bytecode expectations, public API compatibility, tests, lint, and migration guardrails.4license: Apache-2.05---67# Java Android Workflow89## Purpose1011Preserve Java Android codebases and make Kotlin/Java boundaries explicit when Android modules are mixed-language.1213The practical decision is whether to stay Java-only, add Kotlin interop carefully, or route implementation to Kotlin-first guidance without forcing a migration.1415## Source Check1617Use repo-local Java, Kotlin, Gradle, and Android files first. Use Dash.app Java or Gradle docsets opportunistically for installed local reference. Use official documentation as authority for Android-specific APIs, Kotlin Java interop, AndroidX behavior, and version-sensitive rules:1819- [Android Developers documentation](https://developer.android.com/docs)20- [Java documentation](https://docs.oracle.com/en/java/)21- [Kotlin Java interoperability documentation](https://kotlinlang.org/docs/java-interop.html)22- [AndroidX documentation](https://developer.android.com/jetpack/androidx)23- [Android build documentation](https://developer.android.com/build)2425Translate documentation into concrete API, annotation, source-set, or validation choices.2627## Inspection Workflow28291. Inspect source ownership:30 - `src/main/java`31 - `src/main/kotlin`32 - generated sources33 - public Android library APIs34 - Java callers of Kotlin code and Kotlin callers of Java code352. Identify interop boundaries:36 - nullability annotations37 - `@JvmName`, `@JvmOverloads`, `@JvmStatic`, `@JvmField`, or `@Throws`38 - SAM conversions and functional interfaces39 - checked exceptions and callback APIs40 - data classes, sealed classes, objects, companion objects, and generated bytecode as seen from Java413. Preserve Java-only projects:42 - keep Java examples and implementation idiomatic for the existing codebase43 - do not add Kotlin plugin or Kotlin sources without user approval44 - keep AndroidX and Java language level aligned with repo configuration454. Maintain mixed projects:46 - keep public APIs friendly from both languages when they already cross the boundary47 - use annotations for nullability and threading where the repo already does48 - keep generated binding, Room, Hilt, KSP, KAPT, or annotation processing behavior explicit495. Validate:50 - compile or assemble the affected module51 - run unit tests that exercise the Java/Kotlin boundary52 - run lint when annotations, threading, lifecycle, resources, or Android APIs changed5354## Implementation Guidance5556- Prefer Java implementation in Java-dominant Android modules.57- Prefer Kotlin implementation in Kotlin-dominant modules unless Java API compatibility owns the change.58- Keep Android callbacks, listeners, and lifecycle methods readable from the language that owns the file.59- Preserve binary and source compatibility for Android libraries unless the user approves a breaking change.60- Document migration decisions in repo-facing docs only when the task changes project policy.6162## Output Shape6364Return:65661. `Language owner`: Java-only, Kotlin-first, mixed, or migration decision needed.672. `Interop boundary`: APIs, annotations, generated code, callbacks, nullability, or bytecode concerns.683. `Affected modules`: module, source set, public APIs, tests, and generated sources.694. `Validation path`: exact Gradle commands.705. `Risk`: migration, binary compatibility, annotation processing, nullability, or public API risk.7172## Guardrails7374- Do not rewrite Java Android code to Kotlin just because Kotlin is preferred for new Android work.75- Do not add Kotlin to a Java-only project without an explicit user decision.76- Do not expose awkward Kotlin APIs to Java callers when public interop matters.77- Do not drop nullability, threading, or lifecycle annotations casually.78- Do not route backend Java services through this skill.