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

72ffb135de71bef2c4a11961634edc6a?s=128

Miguel Beltran

May 29, 2019
Tweet

Transcript

  1. What’s New in Kotlin Google I/O 2019

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

    official Kotlin support Creation of Foundation: - Lead Language Designer - Control breaking changes via Language Committee
  3. 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
  4. Capturing ‘when’ val response = getResponse() when (response) { OK

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

    process(response) CANCELED -> print("canceled") }
  6. Experimental Annotation @Experimental(level = WARNING) annotation class NewAPI @NewAPI class

    MyService val service = MyService()
  7. Contracts fun MyClass?.notNull(): Boolean { contract { returns(true) implies(this@notNull !=

    null) } return this != null }
  8. Serializable Annotation @Serializable data class Customer( val id: Int, val

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

    = flow { delay(1000) emit(42) } values.collect { value -> println("Received $value") }
  10. 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)
  11. Better Community Support ➔ Code Samples in Kotlin ➔ New

    Online Training w/ Udacity
  12. None
  13. None