WIZELINEwww.wizeline.comproprietary+confidentialwww.wizeline.comWIZELINEproprietary+confidential
Kotlin
Understand the Magic
wizeline.com | confidential - do not distribute 2
• Sr. Android Engineer at Wizeline
• Android Mobile Team lead
• 8 year of Experiences in Java and Android
HIEN NGO
HCMC, VN
WIZELINE
About Kotlin
Understand Kotlin top feature
Kotlin Puzzlers
QA
Kotlin
Understand the Magic
SLIDE
4
About Kotlin
● Jul 2011, introduced by JetBrain
● Feb 2016, Kotlin 1.0 released
● Google I/O 2017, Google officially support Kotlin on Android
SLIDE
5Most Loved Languages Most Wanted Languages
Source: StackOverFlow 2017 Insight
SLIDE
6
Source: Realm Report
SLIDE
7
About Kotlin
● OOP Programming Language
● Fully Java compatible
● Functional Programming Style
● Basics, Smart, Safety, Minimal, Flexibility
SLIDE
8
About Kotlin
● Multiplatforms with Kotlin
○ Server: Kotlin/JVM, Ktor https://ktor.io/
○ Web page: Kotlin/JS
https://github.com/jetbrains/create-react-kotlin-app
○ Android: Kotlin/JVM
○ iOS: Kotlin/Native
https://github.com/JetBrains/kotlin-native/tree/master/samples
● Sample App: https://github.com/JetBrains/kotlinconf-app
WIZELINE.COM
Beautiful Future or False Promises
Null Safety
Null Safety
- Nullable types and Non-Null Types
Eg: String - String? , View - View?
var greeting: String = "Hello, World"
greeting = null // Compilation Error
var nullableGreeting: String? = "Hello, World"
nullableGreeting = null // Allowed
- Safe call operator: ?.
var length = nullableGreeting?.length()
- Elvis operator: ?:
var currentCompany = user?.profile?.company ?: "Wizeline"
- Not null assertion : !! Operator
var length = nullableGreeting!!.length()
Null Safety
Null Safety
Null Safety
Null Safety
Null Safety
Null Safety
Data Class
Data Class
-
Data Class
Data Class
Extension
Function
Extend a class with new functionality
without having to inherit from the class or
use any type of design pattern such as
Decorator
Extension
Function
Extension
Function
Extension
Function
Higher Order
Functions
A function that takes functions as
parameters (callbacks), or returns a
function
Higher Order
Functions
Higher Order
Functions
Higher Order
Functions
Higher Order
Functions
Higher Order
Functions
Higher Order
Functions
DSL
A domain-specific language (DSL) is a computer language
specialized to a particular application domain. This is in contrast
to a general-purpose language (GPL), which is broadly applicable
across domains.
DSL
Source: Anko Library For Android
DSL
DSL
DSL
SLIDE
39
Many More….
- Coroutines
- Type Check and Smart Casts
- Collection Processing
- Depreciation Handler
- Any, Nothing and Unit
- Delegation
....
WIZELINE.COM
Kotlin Puzzler
sales@wizeline.com
THANK
YOU
Feedback:
https://goo.gl/o2oRAQ
hien.ngo@wizeline.com

Grokking TechTalk #26: Kotlin, Understand the Magic