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 Slide

  2. java 8

    View Slide

  3. java 8?

    View Slide

  4. yes, but…
    java 8?

    View Slide

  5. View Slide

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

    View Slide

  7. 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 Slide

  8. 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 Slide

  9. jack

    View Slide

  10. View Slide

  11. 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 Slide

  12. jack?
    yes, but…

    View Slide

  13. 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 Slide

  14. DEPRECATED

    View Slide

  15. very cool!

    View Slide

  16. very cool!
    yes, but…

    View Slide

  17. what does
    that mean?

    View Slide

  18. 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 Slide

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

    View Slide

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

    View Slide

  21. …questions

    View Slide