• R8 Optimization: Staticization

    Note: This post is part of a series on D8 and R8, Android’s new dexer and optimizer, respectively. For an intro to D8 read “Android’s Java 8 support”. This post introduces R8. The first three posts (1, 2, 3) in this series explored D8. Among its core responsibility of converting Java bytecode to Dalvik bytecode,…

    Read More

  • R8 Optimization: Null Data Flow Analysis (Part 1)

    Note: This post is part of a series on D8 and R8, Android’s new dexer and optimizer, respectively. For an intro to D8 read “Android’s Java 8 support”. For an intro to R8 read “R8 Optimization: Staticization”. The last post in this series was the first to cover R8 and one of its optimizations. This…

    Read More

  • Inline Classes Make Great Database IDs

    Kotlin 1.3’s experimental inline class feature allows creating type-safe, semantic wrappers around values which are erased at runtime. Database IDs are a perfect use case for this functionality. Combined with SQLDelight which automatically generates model objects and APIs for querying, different table’s IDs become different types which prevent erroneous use. In modeling an app that…

    Read More

  • R8 Optimization: Null Data Flow Analysis (Part 2)

    Note: This post is part of a series on D8 and R8, Android’s new dexer and optimizer, respectively. For an intro to D8 read “Android’s Java 8 support”. For an intro to R8 read “R8 Optimization: Staticization”. Part 1 of this post demonstrated R8’s ability to eliminate null checks after method inlining. This was accomplished…

    Read More

  • Increased accuracy of aapt2 “keep” rules

    The aapt2 tool packages your Android application resources into the format used at runtime. It also generates “keep” rules for ProGuard or R8 so that the types referenced inside of your resources do not get removed. Views referenced only in layout XML, action providers referenced only in menu XML, and broadcast receivers referenced only in…

    Read More

  • Android’s Java 8 Support

    I’ve worked from home for a few years, and during that time I’ve heard people around the office complaining about Android’s varying support for different versions of Java. Every year at Google I/O you could find me asking about it at the fireside chats or directly to the folks responsible. At conferences and other developer…

    Read More

  • Android’s Java 9, 10, 11, and 12 Support

    Note: This post is part of a series on D8 and R8, Android’s new dexer and optimizer, respectively. For an intro to D8 read “Android’s Java 8 support”. The first post in this series explored Android’s Java 8 support. Having support for the language features and APIs of Java 8 is table stakes at this…

    Read More

  • Avoiding Vendor- and Version-Specific VM Bugs

    Note: This post is part of a series on D8 and R8, Android’s new dexer and optimizer, respectively. For an intro to D8 read “Android’s Java 8 support”. The first two posts (1, 2) in this series explored how D8 is responsible for desugaring new Java language features to work on all versions of Android.…

    Read More