README.md

Android UI + API Navigation Analyzer

This skill upgrades the original Android UI navigation analysis workflow into a hybrid LLM + Python script workflow.

Files

  • SKILL.md: operating instructions for the LLM
  • scripts/android_ui_api_analyzer.py: lightweight static analyzer that scans Android code/resources and emits structured JSON
  • schema/ui_api_analysis.schema.json: optional schema for validating analyzer output
  • examples/sample_analysis.json: example intermediate output
  • examples/sample_report.md: example final markdown report

Why this structure

  • The script handles the repetitive, evidence-oriented work: discovery, indexing, shallow call tracing, and JSON emission.
  • SKILL.md handles the reasoning-heavy work: summarizing the page, deciding how to describe components, and turning evidence into a readable report.
  • The split keeps the implementation practical and avoids overbuilding a compiler-grade analyzer.

Requirements

  • Python 3.10+
  • Standard library only

Run

python scripts/android_ui_api_analyzer.py \
  --project /path/to/android-project \
  --activity MainActivity \
  --output /path/to/out/ui_api_analysis.json \
  --pretty

Analyze all discovered activities:

python scripts/android_ui_api_analyzer.py \
  --project /path/to/android-project \
  --output /path/to/out/ui_api_analysis.json \
  --pretty

What the script extracts

  • Activities from AndroidManifest.xml
  • Activity/Fragment layouts from setContentView, DataBinding, ViewBinding, and inflater calls
  • Included layouts and <fragment> declarations
  • Menu resources and menu item IDs/titles
  • Interactive UI bindings such as click, long-click, menu, navigation, refresh, and item handlers
  • Page-level loading entries such as onCreate, initData, loadData, setupObservers, and similar methods
  • Lightweight call chains to declaration-level API evidence:
    • Retrofit declarations
    • Repository methods
    • UseCase / Interactor methods
    • DAO methods
    • ContentResolver / MediaStore usage
    • Intent / ActivityResult / system API usage
    • Service usage
    • Custom wrapper methods when no stronger declaration is found

Important limitations

This is not a compiler-backed call graph.

The analyzer prefers:

  • verifiable declarations
  • source locations
  • shallow static evidence
  • low hallucination

It may stop at the nearest resolvable method declaration when:

  • callbacks are heavily indirect
  • dependency injection types are erased from source
  • reflection, code generation, or dynamic routing is involved
  • adapter click flow is passed through multiple layers of lambdas/interfaces without clear types
  1. Run the script.
  2. Give the generated JSON to the skill.
  3. Let the LLM read the JSON and only open source files when evidence needs disambiguation.
  4. Produce the final markdown report.