~/talk

Build an Android Lint in 25 Minutes

TalkinJapaneseat DroidKaigi 2021 · 2021-10-19..10-21· [android, testing]
links:none on file
slides:none on file

Shows how to add a custom Android Lint rule that detects uses of a project-wide singleton (example BadReferenceObject) when referenced from Activities. Implements the rule as a SourceCodeScanner using UAST and PSI, registers it for Gradle via a registry and lint API version, and verifies it with a focused lintTestTask against small source stubs (tests run locally and report one warning). Gives practical tips: narrow rule scope, keep tiny test files for fast edit→test cycles, debug with breakpoints, and prefer UAST over PSI where suitable.

AI-written summary · about

  1. 0:00Introduction
  2. 2:55Android Lint components
  3. 7:31Lint rule setup
  4. 10:20Test code setup
  5. 14:47AST/PSI scanning
  6. 21:07Detecting bad refs
  7. 22:51Customizing reports
  8. 24:38Rule creation tips
  9. 25:22Implementation tips
  10. 26:45Summary
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.