Android Code Validator
android_code_validatorValidate Kotlin, XML, and Gradle code against 34 Android rules to catch deprecated APIs, coroutine misuse, and version issues. Returns PASS/WARN/FAIL with line-level fixes and doc links.
Instructions
Call after generating every Android code block, before returning it. Checks Kotlin, XML, and Gradle against 34 rules (removed/deprecated APIs, Android 16/17 behaviour, coroutine misuse, kapt). Returns PASS/WARN/FAIL with line-level fixes and doc links, plus structuredContent. Comments are ignored. On FAIL, fix and re-run.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | The code block to validate | |
| minSdk | No | App minSdk (e.g. 24) | |
| language | No | File type — auto-detected from content if omitted | |
| targetSdk | No | App targetSdk (e.g. 37) |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| counts | Yes | ||
| minSdk | Yes | ||
| verdict | Yes | ||
| language | Yes | ||
| targetSdk | Yes | ||
| violations | Yes | ||
| rulesEvaluated | Yes |