Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Java 8 and Android and You

Java 8 and Android and You

Let's look at the status of Java 8 in the Android world. How can you use it? What are the limitations? Workarounds? And what is this thing with Jack and Jill anyway?

-----

Hack & Tell presented at Novoda -> http://novoda.tv
Video: https://www.youtube.com/watch?v=lEwIK3EY2g8

Sebastiano Poggi

March 21, 2017
Tweet

More Decks by Sebastiano Poggi

Other Decks in Technology

Transcript

  1. Sebastiano
    Poggi
    java 8
    and
    android
    and
    you

    View full-size slide

  2. yes, but…
    java 8?

    View full-size slide

  3. java 8
    added in android 7.0
    no more harmony
    switched to openjdk
    partial support*
    *varies by os version

    View full-size slide

  4. java 8
    best case scenario (api 24+)
    lambdas and method references
    java.util.function
    streaming and reflection apis
    repeatable annotations
    default and static interface methods

    View full-size slide

  5. java 8
    on pre-24
    lambdas and method references
    java.util.function
    runtime
    crash!
    streaming and reflection apis
    repeatable annotations
    default and static interface methods

    View full-size slide

  6. jack
    new compiling toolchain
    no javac/dx, one tool to rule them all
    .jack bytecode as intermediate language
    jill handles legacy .class files
    supports java 8 language features

    View full-size slide

  7. jack?
    yes, but…

    View full-size slide

  8. jack
    no .class means no java tooling
    no *guard, no mockito, no jacoco...
    no instant run support
    in alpha since announced
    and most importantly…

    View full-size slide

  9. very cool!
    yes, but…

    View full-size slide

  10. what does
    that mean?

    View full-size slide

  11. the future
    likely to match jack java 8 support
    language features: partial backport
    new api: no backport
    basically like using retrolambda
    we can keep our tooling

    View full-size slide

  12. under the hood
    desugarer from bazel
    backports java 8 features
    bytecode manipulation
    anon inner classes for lambdas
    again, just like retrolambda (ish)

    View full-size slide

  13. source: https://realm.io/news/360andev-jake-wharton-java-hidden-costs-android/

    View full-size slide

  14. …questions

    View full-size slide