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 LLMscripts/android_ui_api_analyzer.py: lightweight static analyzer that scans Android code/resources and emits structured JSONschema/ui_api_analysis.schema.json: optional schema for validating analyzer outputexamples/sample_analysis.json: example intermediate outputexamples/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.mdhandles 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
Recommended workflow
- Run the script.
- Give the generated JSON to the skill.
- Let the LLM read the JSON and only open source files when evidence needs disambiguation.
- Produce the final markdown report.