An Introduction to Kotlin for Android
Development
Víctor Bolinches - @vicboma1
My Profile
Victor Bolinches vicboma1 @vicboma1 Victor Bolinches
Víctor Bolinches
Software Architect - Capgemini S.L.
[email protected]
2
Introduction
OnResume {
Why Kotlin ?
From Java to Kotlin
Android Studio
Examples
Conclusion
Miscellaneous
References
}
Why Kotlin ?
OnStart {
Google official language
Compilations
IDE’s
Build Tools
}
Click to insert text
Why Kotlin ?
Click to insert text
Google official language
Click to insert text
Why Kotlin ?
Statically typed Concise Safe Versatile Interoperable Tool-friendly
programming
Language
(JVM 100%)
Click to insert text
Compilations
Kotlin/JVM Kotlin/JS Kotlin/Android Kotlin/Native
[ LLVM bitcode ]
Click to insert text
IDE’s
Eclipse NetBeans IntelliJ Idea Android Studio
Eclipse Android Studio
Click to insert text
Build Tools
Apache Ant Maven Gradle
L Griffon
From Java to Kotlin
OnCreate {
Basics,
Null Safety,
When, Iterators,
Functions, Classes,
Closures,
Ext Functions,
Coroutine
}
Click to insert text
From Java to Kotlin
Click to insert text
Basics - Part 1
Java Kotlin
Click to insert text
Basics - Part 2
Java Kotlin
Click to insert text
Iterators
Java Kotlin
Click to insert text
When Expression
Java Kotlin
Click to insert text
Functions
Java Kotlin
Click to insert text
Classes 1
Java Kotlin
Click to insert text
Classes 2
Java Kotlin
Click to insert text
Closures
Java Kotlin
Click to insert text
Ext Function
Java Kotlin
Click to insert text
Coroutine
Kotlin
Job
Continuation<T>
Click to insert text
Coroutine
Kotlin
Non Blocking
Blocking
Android Studio
OnCreate {
Installation,
Configuration
}
Click to insert text
Installation
Canary Android Studio
Click to insert text
Configuration
Click to insert text
Configuration - Platform
Click to insert text
Configuration - Tools
Click to insert text
Configuration - Update
Click to insert text
Project
Click to insert text
Project
Click to insert text
Project - Coroutine
Click to insert text
Project - Coroutine
Examples
OnDestroy {
Repository
Syntax review
Manager Fragment
}
Click to insert text
Repository
Click to insert text
Syntax review
Kotlin - Activity Life Cycle
Click to insert text
Syntax review
Kotlin - Activity Life Cycle
Click to insert text
Syntax review
Java - Activity
Click to insert text
Syntax review
Kotlin - Activity
Click to insert text
Syntax review
Kotlin - Fragment Life Cycle
Click to insert text
Hello world w/Button
Repository
Click to insert text
Transition Activity
Repository
Click to insert text
Manager Fragment App
Repository
Click to insert text
Manager Fragment App
With
Ext Functions
Repository
Click to insert text
Manager Fragment App
With
Ext | High Order | Lambdas Functions
Repository
Click to insert text
Finite State Machine
Repository
Click to insert text
Transition Animation
Color w/ Coroutines
Repository
Conclusion
Click to insert text
KoTlin
• Interoperable with Java (100%)
• Reduces Boilerplate code
• Synthetic extension for coding that can add
• Object-Oriented and procedural
• Safety code
• No Semicolon
• No overhead to using code (Systematic boxing and unboxing)
• Expands us skillset
• Perfect Support with Android Studio & Gradle
• Very easy to get started with Android Develop
Click to insert text
Conclusion
Deprecate Java
Miscellaneous
OnPause {
Getting Started Kotlin
Kotlin Koans
Problems Kotlin
GameBoy Emulator Environment
Anko
Ktor
Android KTX
}
Click to insert text
Getting Started Kotlin
Repository
Click to insert text
Kotlin Koans
Repository
Click to insert text
Problems Kotlin
Repository
Click to insert text
GameBoy Emulator
Environment
Repository
Click to insert text
Anko - DSL Library
Repository
Click to insert text
Ktor - Async Server - Client
Repository
Click to insert text
Android KTX
Repository
References
Click to insert text
References
● https://github.com/vicboma1
● https://github.com/vicboma1/Kotlin-Koans
● https://github.com/vicboma1/GettingStartedKotlin
● https://github.com/vicboma1/Kotlin-Examples-Problems/
● https://github.com/vicboma1/GameBoyEmulatorEnvironment
● https://github.com/MindorksOpenSource/from-java-to-kotlin
● https://kotlin.es/
● https://www.upwork.com/hiring/for-clients/kotlin-might-replace-java/
● https://gradle.org/docs/
● https://developer.android.com/studio/
● https://github.com/futurice/android-best-practices
● http://ktor.io/
● http://arrow-kt.io/
● https://github.com/Kotlin/anko
● https://github.com/android/android-ktx
● https://developer.android.com/ndk/index.html
About Capgemini
With more than 190,000 people, Capgemini is present in over 40
countries and celebrates its 50th Anniversary year in 2017. A
global leader in consulting, technology and outsourcing services,
the Group reported 2016 global revenues of EUR 12.5 billion.
Together with its clients, Capgemini creates and delivers business,
technology and digital solutions that fit their needs, enabling them
to achieve innovation and competitiveness. A deeply multicultural
organization, Capgemini has developed its own way of working,
Learn more about us at
the Collaborative Business Experience™, and draws on
®
www.capgemini.
Rightshore , its worldwide delivery model.
com
This message contains information that may be privileged or
confidential and is the property of the Capgemini Group. This message is intended only for the person to whom it is addressed. If you are not the intended
Copyright © 2017 Capgemini. All rights reserved. recipient, you are not authorized to read, print, retain, copy, disseminate, distribute, or use this
message or any part thereof. If you receive this message in error, please notify the sender
Rightshore® is a trademark belonging to Capgemini. immediately and delete all copies of this message.