A stripped down version of the Android SDK's layoutlib.jar
.
Unfortunately, the private APIs we need access to include an abstract class which we must subclass. This is not possible via reflection. Instead, we'll simply provider a JAR with the necessary methods, making the whole thing a breeze. The APIs have so far stayed almost entirely stable.
Copy one of the layoutlib.jar
files in your Android SDK folder to the libs
folder in this module. You can then optionally run ./strip.sh
to remove any unnecessary content from it, slimming the archive down considerably.
The current base file is $ANDROID_SDK/platforms/android-21/data/layoutlib.jar
.