development an introduction to kotlin for androidenglishonlineclub.com/pdf/an introduction to kotlin...

61
Víctor Bolinches - @vicboma1 An Introduction to Kotlin for Android Development

Upload: others

Post on 14-Aug-2020

16 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Development An Introduction to Kotlin for Androidenglishonlineclub.com/pdf/An Introduction to Kotlin for Android... · • Object-Oriented and procedural • Safety code • No Semicolon

Víctor Bolinches - @vicboma1

An Introduction to Kotlin for Android Development

Page 2: Development An Introduction to Kotlin for Androidenglishonlineclub.com/pdf/An Introduction to Kotlin for Android... · • Object-Oriented and procedural • Safety code • No Semicolon

Capgemini Blue

R 0G 112B 173

VibrantBlue

R 18G 171B 219

DeepPurple

R 43G 10B 61

TechRed

R 255G 48B 76

ZestGreen

R 149G 230B 22

Capgemini Blue (-50%)

R 128G 184B 214

VibrantBlue (-50%)

R 136G 213B 237

BrightPurple

R 109G 100B 204

Orange

R 255G 99B 39

BrightGreen

R 200G 255B 22

Purple

R 126G 57B 186

Green

R 0G 195B 123

DarkGreen

R 21G 99B 107

Aqua

R 15G 153B 156

BrightAqua

R 1G 209B 208

Peach

R 255G 126B 131

LightClaret

R 203G 41B 128

Claret

R 134G 8B 100

Primary

Infographic

Secondary

DarkPurple

R 71G 1B 167

2

Víctor Bolinches

Software Architect - Capgemini S.L.

[email protected]

vicboma1 @vicboma1Victor Bolinches

My Profile

Victor Bolinches

Page 3: Development An Introduction to Kotlin for Androidenglishonlineclub.com/pdf/An Introduction to Kotlin for Android... · • Object-Oriented and procedural • Safety code • No Semicolon

IntroductionOnResume {

Why Kotlin ?From Java to Kotlin

Android StudioExamples

Conclusion Miscellaneous

References

}

Page 4: Development An Introduction to Kotlin for Androidenglishonlineclub.com/pdf/An Introduction to Kotlin for Android... · • Object-Oriented and procedural • Safety code • No Semicolon

Why Kotlin ?OnStart {

Google official languageCompilations

IDE’s

Build Tools

}

Page 6: Development An Introduction to Kotlin for Androidenglishonlineclub.com/pdf/An Introduction to Kotlin for Android... · • Object-Oriented and procedural • Safety code • No Semicolon

Click to insert text

Google official language

Page 7: Development An Introduction to Kotlin for Androidenglishonlineclub.com/pdf/An Introduction to Kotlin for Android... · • Object-Oriented and procedural • Safety code • No Semicolon

Click to insert text

Why Kotlin ?

Safe Versatile Interoperable Tool-friendlyStatically typed programming

Language

(JVM 100%)

Concise

Page 8: Development An Introduction to Kotlin for Androidenglishonlineclub.com/pdf/An Introduction to Kotlin for Android... · • Object-Oriented and procedural • Safety code • No Semicolon

Click to insert text

Compilations

Kotlin/JVM Kotlin/JS Kotlin/Native

[ LLVM bitcode ]

Kotlin/Android

Page 9: Development An Introduction to Kotlin for Androidenglishonlineclub.com/pdf/An Introduction to Kotlin for Android... · • Object-Oriented and procedural • Safety code • No Semicolon

Click to insert text

IDE’s

Eclipse Android StudioEclipse NetBeans Android StudioIntelliJ Idea

Page 10: Development An Introduction to Kotlin for Androidenglishonlineclub.com/pdf/An Introduction to Kotlin for Android... · • Object-Oriented and procedural • Safety code • No Semicolon

Click to insert text

Build Tools

GriffonApache Ant Maven Gradle L

Page 11: Development An Introduction to Kotlin for Androidenglishonlineclub.com/pdf/An Introduction to Kotlin for Android... · • Object-Oriented and procedural • Safety code • No Semicolon

From Java to Kotlin

OnCreate { Basics,Null Safety,When, Iterators,Functions, Classes,Closures,Ext Functions,Coroutine

}

Page 12: Development An Introduction to Kotlin for Androidenglishonlineclub.com/pdf/An Introduction to Kotlin for Android... · • Object-Oriented and procedural • Safety code • No Semicolon

Click to insert text

From Java to Kotlin

Page 13: Development An Introduction to Kotlin for Androidenglishonlineclub.com/pdf/An Introduction to Kotlin for Android... · • Object-Oriented and procedural • Safety code • No Semicolon

Click to insert text

Basics - Part 1Java Kotlin

Page 14: Development An Introduction to Kotlin for Androidenglishonlineclub.com/pdf/An Introduction to Kotlin for Android... · • Object-Oriented and procedural • Safety code • No Semicolon

Click to insert text

Basics - Part 2Java Kotlin

Page 15: Development An Introduction to Kotlin for Androidenglishonlineclub.com/pdf/An Introduction to Kotlin for Android... · • Object-Oriented and procedural • Safety code • No Semicolon

Click to insert text

IteratorsJava Kotlin

Page 16: Development An Introduction to Kotlin for Androidenglishonlineclub.com/pdf/An Introduction to Kotlin for Android... · • Object-Oriented and procedural • Safety code • No Semicolon

Click to insert text

When ExpressionJava Kotlin

Page 17: Development An Introduction to Kotlin for Androidenglishonlineclub.com/pdf/An Introduction to Kotlin for Android... · • Object-Oriented and procedural • Safety code • No Semicolon

Click to insert text

FunctionsJava Kotlin

Page 18: Development An Introduction to Kotlin for Androidenglishonlineclub.com/pdf/An Introduction to Kotlin for Android... · • Object-Oriented and procedural • Safety code • No Semicolon

Click to insert text

Classes 1Java Kotlin

Page 19: Development An Introduction to Kotlin for Androidenglishonlineclub.com/pdf/An Introduction to Kotlin for Android... · • Object-Oriented and procedural • Safety code • No Semicolon

Click to insert text

Classes 2Java Kotlin

Page 20: Development An Introduction to Kotlin for Androidenglishonlineclub.com/pdf/An Introduction to Kotlin for Android... · • Object-Oriented and procedural • Safety code • No Semicolon

Click to insert text

ClosuresJava Kotlin

Page 21: Development An Introduction to Kotlin for Androidenglishonlineclub.com/pdf/An Introduction to Kotlin for Android... · • Object-Oriented and procedural • Safety code • No Semicolon

Click to insert text

Ext FunctionJava Kotlin

Page 24: Development An Introduction to Kotlin for Androidenglishonlineclub.com/pdf/An Introduction to Kotlin for Android... · • Object-Oriented and procedural • Safety code • No Semicolon

Android Studio

OnCreate { Installation,Configuration

}

Page 27: Development An Introduction to Kotlin for Androidenglishonlineclub.com/pdf/An Introduction to Kotlin for Android... · • Object-Oriented and procedural • Safety code • No Semicolon

Click to insert text

Configuration - Platform

Page 28: Development An Introduction to Kotlin for Androidenglishonlineclub.com/pdf/An Introduction to Kotlin for Android... · • Object-Oriented and procedural • Safety code • No Semicolon

Click to insert text

Configuration - Tools

Page 29: Development An Introduction to Kotlin for Androidenglishonlineclub.com/pdf/An Introduction to Kotlin for Android... · • Object-Oriented and procedural • Safety code • No Semicolon

Click to insert text

Configuration - Update

Page 32: Development An Introduction to Kotlin for Androidenglishonlineclub.com/pdf/An Introduction to Kotlin for Android... · • Object-Oriented and procedural • Safety code • No Semicolon

Click to insert text

Project - Coroutine

Page 33: Development An Introduction to Kotlin for Androidenglishonlineclub.com/pdf/An Introduction to Kotlin for Android... · • Object-Oriented and procedural • Safety code • No Semicolon

Click to insert text

Project - Coroutine

Page 34: Development An Introduction to Kotlin for Androidenglishonlineclub.com/pdf/An Introduction to Kotlin for Android... · • Object-Oriented and procedural • Safety code • No Semicolon

Examples

OnDestroy { RepositorySyntax reviewManager Fragment

}

Page 36: Development An Introduction to Kotlin for Androidenglishonlineclub.com/pdf/An Introduction to Kotlin for Android... · • Object-Oriented and procedural • Safety code • No Semicolon

Click to insert text

Syntax review

Kotlin - Activity Life Cycle

Page 37: Development An Introduction to Kotlin for Androidenglishonlineclub.com/pdf/An Introduction to Kotlin for Android... · • Object-Oriented and procedural • Safety code • No Semicolon

Click to insert text

Syntax review

Kotlin - Activity Life Cycle

Page 38: Development An Introduction to Kotlin for Androidenglishonlineclub.com/pdf/An Introduction to Kotlin for Android... · • Object-Oriented and procedural • Safety code • No Semicolon

Click to insert text

Syntax review

Java - Activity

Page 39: Development An Introduction to Kotlin for Androidenglishonlineclub.com/pdf/An Introduction to Kotlin for Android... · • Object-Oriented and procedural • Safety code • No Semicolon

Click to insert text

Syntax review

Kotlin - Activity

Page 40: Development An Introduction to Kotlin for Androidenglishonlineclub.com/pdf/An Introduction to Kotlin for Android... · • Object-Oriented and procedural • Safety code • No Semicolon

Click to insert text

Syntax review

Kotlin - Fragment Life Cycle

Page 45: Development An Introduction to Kotlin for Androidenglishonlineclub.com/pdf/An Introduction to Kotlin for Android... · • Object-Oriented and procedural • Safety code • No Semicolon

Click to insert text

Manager Fragment App With Ext | High Order | Lambdas Functions

Repository

Page 47: Development An Introduction to Kotlin for Androidenglishonlineclub.com/pdf/An Introduction to Kotlin for Android... · • Object-Oriented and procedural • Safety code • No Semicolon

Click to insert text

Transition Animation Color w/ Coroutines

Repository

Page 48: Development An Introduction to Kotlin for Androidenglishonlineclub.com/pdf/An Introduction to Kotlin for Android... · • Object-Oriented and procedural • Safety code • No Semicolon

Conclusion

Page 49: Development An Introduction to Kotlin for Androidenglishonlineclub.com/pdf/An Introduction to Kotlin for Android... · • Object-Oriented and procedural • Safety code • No Semicolon

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

Page 50: Development An Introduction to Kotlin for Androidenglishonlineclub.com/pdf/An Introduction to Kotlin for Android... · • Object-Oriented and procedural • Safety code • No Semicolon

Click to insert text

Conclusion

Deprecate Java

Page 51: Development An Introduction to Kotlin for Androidenglishonlineclub.com/pdf/An Introduction to Kotlin for Android... · • Object-Oriented and procedural • Safety code • No Semicolon

Miscellaneous

OnPause { Getting Started KotlinKotlin KoansProblems KotlinGameBoy Emulator EnvironmentAnkoKtorAndroid KTX

}

Page 57: Development An Introduction to Kotlin for Androidenglishonlineclub.com/pdf/An Introduction to Kotlin for Android... · • Object-Oriented and procedural • Safety code • No Semicolon

Click to insert text

Ktor - Async Server - Client

Repository

Page 59: Development An Introduction to Kotlin for Androidenglishonlineclub.com/pdf/An Introduction to Kotlin for Android... · • Object-Oriented and procedural • Safety code • No Semicolon

References

Page 60: Development An Introduction to Kotlin for Androidenglishonlineclub.com/pdf/An Introduction to Kotlin for Android... · • Object-Oriented and procedural • Safety code • No Semicolon

Click to insert text

● 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

References

Page 61: Development An Introduction to Kotlin for Androidenglishonlineclub.com/pdf/An Introduction to Kotlin for Android... · • Object-Oriented and procedural • Safety code • No Semicolon

Capgemini Blue

R 0G 112B 173

VibrantBlue

R 18G 171B 219

DeepPurple

R 43G 10B 61

TechRed

R 255G 48B 76

ZestGreen

R 149G 230B 22

Capgemini Blue (-50%)

R 128G 184B 214

VibrantBlue (-50%)

R 136G 213B 237

BrightPurple

R 109G 100B 204

Orange

R 255G 99B 39

BrightGreen

R 200G 255B 22

Purple

R 126G 57B 186

Green

R 0G 195B 123

DarkGreen

R 21G 99B 107

Aqua

R 15G 153B 156

BrightAqua

R 1G 209B 208

Peach

R 255G 126B 131

LightClaret

R 203G 41B 128

Claret

R 134G 8B 100

Primary

Infographic

Secondary

DarkPurple

R 71G 1B 167

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, the Collaborative Business Experience™, and draws on Rightshore®, its worldwide delivery model.

About Capgemini

Learn more about us at

www.capgemini.com

This message contains information that may be privileged or confidential and is the property of the Capgemini Group.Copyright © 2017 Capgemini. All rights reserved.

Rightshore® is a trademark belonging to Capgemini.

This message is intended only for the person to whom it is addressed. If you are not the intended 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 immediately and delete all copies of this message.