Q: How to generate code that uses Android APIs I have a java library that generates code for our Android project.
We are using this to lower the amount of code we need to write in some of our RecyclerView adapters. 
The issue I ran into is that the annotation processor can't depend on the Android framework, which is quite limiting, because we need to reference some Android SDK classes while generating the code.
public interface FeedModuleManager {
     ViewHolder create(ViewGroup parent, int viewType);
}

The annotation processor generates implementations of above interface. (there are more methods, I took that out for brevity)
What I did is that I created stubbed out versions of those classes (ViewGroup and ViewHolder), but it's causing some issues here and there across our build and tooling stack.
So I'm looking for some better way how to do this..
Any thoughts?

A: There are no such libraries, for all I know. There is a javapoet, but it generates the code exactly as you specify. But in no way do for example the implementation of all methods of a specific interface. Most likely this decision will have to be programmed.
