3
Himanshu Singh
Android @Clue, GDE - Android,Kotlin
Slide 4
Slide 4 text
4
Agenda: Backend for Android Engineers
01. Intro
Kotlin
Android?
Backend
Benefits
02. Kotlin Frameworks
Ktor
Spring Boot
Vertx. Etc.
03. Ktor
Why?
How?
Benefits
04. Tutorial
Setting up
Restful APIs
Routing
HTTP Verbs
Features
Location
Status Pages
05. Why to use as Android Developer?
Slide 5
Slide 5 text
01.
Introduction
Slide 6
Slide 6 text
6
Introduction
01.
Kotlin?
Slide 7
Slide 7 text
7
Introduction
01.
Kotlin? Android?
Slide 8
Slide 8 text
8
Introduction
01.
Kotlin? Android? Backend
Slide 9
Slide 9 text
Benefits
1.
2.
3.
4.
5.
Expressive
Tooling
Migration
6.
Scalable!
Community Support
Ease of Learning
Slide 10
Slide 10 text
02.
Frameworks
Slide 11
Slide 11 text
Frameworks
1.
2.
3.
4.
5.
Ktor
Micronauts
Vertx
Spring Boot
A lot more!
Slide 12
Slide 12 text
03.
Ktor
Slide 13
Slide 13 text
13

Ktor
Why?
Slide 14
Slide 14 text
Ktor
1.
2.
3.
4.
5.
Light weighted
Backed by Jetbrains
Coroutine support
Open sourced
Scalable ->
∞
Slide 15
Slide 15 text
04.
Tutorial.
Slide 16
Slide 16 text
16

Tutorial: Web
https://start.ktor.io/
Slide 17
Slide 17 text
17

Tutorial: Web
Slide 18
Slide 18 text
18

Tutorial: Web
Create Project
Slide 19
Slide 19 text
19

Tutorial: Web
Create Project
Slide 20
Slide 20 text
20

Tutorial: Output
Slide 21
Slide 21 text
Code run through!
Slide 22
Slide 22 text
22

fun main() {
embeddedServer(Netty, port = 8080, host = "0.0.0.0") {
configureRouting()
}.start(wait = true)
}
Slide 23
Slide 23 text
23

fun main() {
embeddedServer(Netty, port = 8080, host = "0.0.0.0") {
configureRouting()
}.start(wait = true)
}
Slide 24
Slide 24 text
24

fun main() {
embeddedServer(Netty, port = 8080, host = "0.0.0.0") {
configureRouting()
}.start(wait = true)
}
Slide 25
Slide 25 text
05.
Routing
Slide 26
Slide 26 text
26

fun Application.configureRouting() {
// Starting point for a Ktor app:
routing {
get("/") {
call.respondText("Hello World!")
}
}
}
Slide 27
Slide 27 text
27

fun Application.configureRouting() {
// Starting point for a Ktor app:
routing {
get("/") {
call.respondText("Hello World!")
}
}
}
Slide 28
Slide 28 text
28

fun Application.configureRouting() {
// Starting point for a Ktor app:
routing {
get("/") {
call.respondText("Hello World!")
}
}
}
Slide 29
Slide 29 text
29

fun Application.configureRouting() {
// Starting point for a Ktor app:
routing {
get("/") {
call.respondText("Hello World!")
}
}
}
Slide 30
Slide 30 text
30

fun Application.configureRouting() {
// Starting point for a Ktor app:
routing {
get("/") {
call.respondText("Hello World!")
}
}
}