Slide 1

Slide 1 text

No content

Slide 2

Slide 2 text

About speaker Hello! I’m Toan Kotlin GDE, Android folk @Lazada https://toan.mobi toantran-ea toan_mobi

Slide 3

Slide 3 text

Kotlin for fullstack web/apps development 1. What is Kotlin? (2 mins ) 2. Why Kotlin? (5 mins ) 3. Kotlin multiple platform to power us (10 mins ) 4. Deep-dive into code to understand KMP (15 mins ) 5. Key-takeaways. (3 mins )

Slide 4

Slide 4 text

What is Kotlin The Kotlin language project started in 2010 and soon went open-source

Slide 5

Slide 5 text

Kotlin evolution v1.0: stable release v1.1: coroutines (experimental ) v1.2: Kotlin multiple platforms/Kotlin native (experimental) v1.3: coroutine (stable ) v1.4: Performance improvement

Slide 6

Slide 6 text

GDG Location Why Kotlin? Expressiveness Safety Interoperability Structured concurrency

Slide 7

Slide 7 text

class MainActivity : AppCompatActivity () { override fun onCreate(savedInstanceState: Bundle?) { ... fab.setOnClickListener { view -> Snackbar.make(view, "Hello ${name.capitalize()}", Snackbar.LENGTH_LONG).show() } fab.backgroundTintList = backgroundTintList } } Why Kotlin?

Slide 8

Slide 8 text

class MainActivity : AppCompatActivity () { override fun onCreate(savedInstanceState: Bundle?) { ... fab.setOnClickListener { view -> Snackbar.make(view, "Hello ${name.capitalize()}", Snackbar.LENGTH_LONG).show() } fab.backgroundTintList = backgroundTintList } } Nullability in the type system Why Kotlin?

Slide 9

Slide 9 text

class MainActivity : AppCompatActivity () { override fun onCreate(savedInstanceState: Bundle?) { ... fab.setOnClickListener { view -> Snackbar.make(view, "Hello ${name.capitalize()}", Snackbar.LENGTH_LONG).show() } fab.backgroundTintList = backgroundTintList } } Nullability in the type system Lambdas Why Kotlin?

Slide 10

Slide 10 text

class MainActivity : AppCompatActivity () { override fun onCreate(savedInstanceState: Bundle?) { ... fab.setOnClickListener { view -> Snackbar.make(view, "Hello ${name.capitalize()}", Snackbar.LENGTH_LONG).show() } fab.backgroundTintList = backgroundTintList } } Nullability in the type system Lambdas Extension functions Why Kotlin?

Slide 11

Slide 11 text

class MainActivity : AppCompatActivity () { override fun onCreate(savedInstanceState: Bundle?) { ... fab.setOnClickListener { view -> Snackbar.make(view, "Hello ${name.capitalize()}", Snackbar.LENGTH_LONG).show() } fab.backgroundTintList = backgroundTintList } } Nullability in the type system Lambdas Template expressions Extension functions Why Kotlin?

Slide 12

Slide 12 text

class MainActivity : AppCompatActivity () { override fun onCreate(savedInstanceState: Bundle?) { ... fab.setOnClickListener { view -> Snackbar.make(view, "Hello ${name.capitalize()}", Snackbar.LENGTH_LONG).show() } fab.backgroundTintList = backgroundTintList } } Nullability in the type system Lambdas Template expressions Extension functions Property access syntax for getters and setters Why Kotlin?

Slide 13

Slide 13 text

The major usage of Kotlin right now

Slide 14

Slide 14 text

In my “ideal world” Cross-functional team model

Slide 15

Slide 15 text

How Kotlin Multiple Platform could help? 1. JVM Code 2. JS Code 3. Native Code 4. Common Kotlin

Slide 16

Slide 16 text

KMP - Common Kotlin 1. The language, core libs, basic tools to serve all the platform. 2. Rely on daily-task support tools like Http, serialization, and managing coroutines.

Slide 17

Slide 17 text

Platform specific version of Kotlin 1. Kotlin/JVM, Kotlin/JS, Kotlin/Native: Platform specific libs and tools.

Slide 18

Slide 18 text

Structure of shared code

Slide 19

Slide 19 text

Structure of shared code

Slide 20

Slide 20 text

Structure of shared code

Slide 21

Slide 21 text

Code demo - Project 1

Slide 22

Slide 22 text

Code demo - Project 2

Slide 23

Slide 23 text

Key takeaways 1. Production ready? yes! (KotlinConf 2019: Kotlin in Space by Maxim Mazin) 2. Not everything can be shared a. To share: Data, View Model, Validations, Utils, View Model, RPC, Common Libs b. Not to share: UI, Data storage

Slide 24

Slide 24 text

Key takeaways 3. Where to start? with sample a. Mobile KMP: Kotlin Conf app b. JS/JVM: [email protected]:kotlin-hands-on/jvm-js-fullstack.git c. Another one: [email protected]:Kotlin/kotlin-full-stack-application-demo.git 4. Start with step-by-step guide: here

Slide 25

Slide 25 text

Thank you