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

What's New In Kotlin at Google IO 2019 - Summary

What's New In Kotlin at Google IO 2019 - Summary

Everything that was presented as new in Kotlin at Google IO in 5 minutes

Miguel Beltran

May 29, 2019
Tweet

More Decks by Miguel Beltran

Other Decks in Programming

Transcript

  1. Back To The Future: 2017 2017 Keynote → Google announces

    official Kotlin support Creation of Foundation: - Lead Language Designer - Control breaking changes via Language Committee
  2. State Of Kotlin 2019 ➔ Preferred language by Google for

    Android dev ➔ Best support in Jetpack libraries ◆ KTX, Jetpack Compose, etc. ➔ Used at Google ◆ Drive, Nest, Home, system UI, etc. ➔ Koltin/Native → Now Beta! ➔ Coroutines everywhere
  3. Capturing ‘when’ val response = getResponse() when (response) { OK

    -> process(response) CANCELED -> print("canceled") }
  4. Capturing ‘when’ when (val response = getResponse()) { OK ->

    process(response) CANCELED -> print("canceled") }
  5. Serializable Annotation @Serializable data class Customer( val id: Int, val

    name: String ) Json.stringify(Customer.serializer(), customer)
  6. Flow → Asynchronous cold streams, in preview! val values: Flow<Int>

    = flow { delay(1000) emit(42) } values.collect { value -> println("Received $value") }
  7. More Language Features! ➔ Unsigned Ints ➔ Better parallel builds

    with Gradle ➔ Incremental Annotation Processor with KAPT ➔ New Type Inference Engine (helps with Rx!) ➔ Progressive Mode (more experimental features)