Annotation Processing in Android
summary
Explains how Java compile‑time annotation processing (JSR 269) actually works: use AbstractProcessor with ProcessingEnvironment and RoundEnvironment, generate source via JavaPoet, package the processor in META-INF/services, and split annotations and processor into plain Java Gradle modules (use apt) to run on Android. Tests are hard but Google’s compiled-testing + Truth lets you assert generated sources compile. Covers Gradle javadoc quirks, warns about multiple processing rounds, and cites real users: Butter Knife, Dagger(2), Parceler and Realm, which generates many proxies successfully.
AI-written summary · about
chapters (4)
related talks
43m@Eliminate("Boilerplate")
36mFact or kapt? Build your next annotation processor with KSP
32mWriting Android Libraries
55mCompilers. Dalvik. ART. And everything in between
34mWhat's new with the Android Gradle plugin
40mIntroduction to Bytecode Instrumentation with AGP 8
34mAndroid or the ART of Optimizing Java Code
45mThe Android Build System
