SlideShare a Scribd company logo
Say Goodbye to Java: Getting
Started With Kotlin for
Android
Adam Magaña
Introduction
Introduction
● Adam Magaña
● Lead Mobile Engineer @ Drund
● Currently spending most of my development time working on our Android
application.
A Quick History of Kotlin
A Quick History of Kotlin
● Created by JetBrains
○ Creator of IntelliJ, the IDE that powers Android Studio
● First release - July 2011
● Latest release (1.1.3) - June 2017
● Official endorsement by Google as first-class language - May 2017
● 8,000+ total releases on GitHub
“We believe Kotlin is an excellent fit for
Android not only because it gives
developers what they want, but also
because it matches the spirit of
Android.”
- Google Developer Product Group
Companies Using Kotlin
Companies Using Kotlin
● Pinterest
● Netflix
● AWS
● Uber
● Square
● Trello
10%
Reduction in total methods after converting Basecamp to Kotlin.
30%
Reduction in total lines of code after converting Basecamp to Kotlin.
Addressing Common Concerns
“But I’m comfortable and experienced
with Java.”
● That’s great!
● You ultimately have to use what you’re most comfortable with.
● BUT “give it 5 minutes” before reacting.
“I don’t want to convert my entire
codebase to a new language.”
● Kotlin can be any percentage of your project.
● Fully compatible with JDK 6.
● 100% interoperable with existing Java code.
“I don’t need Kotlin’s special tools to get
the job done.”
● An experienced developer absolutely doesn’t need Kotlin.
● Much can be accomplished with Java.
● BUT barring architectural/performance issues, why would you want
to have less tools available to you?
“I’m worried about the performance
implications of using Kotlin.”
● Performance is as good as an equivalent Java application.
● Kotlin lambdas often run faster than the same code written in Java.
● Incremental project builds using Kotlin are usually faster.
A Very Small Soapbox
A Very Small Soapbox
● Don’t let anyone, myself included, make you feel inadequate for choosing a
different programming language or platform than them.
● Will there be better alternatives to what you use? Yes.
● Does that mean the service you provide to your users is sub-par? No.
● Is it okay to have differing opinions about certain technologies? Absolutely.
● Important to be supportive.
We’re all in this together.
Setting Up Kotlin in Android
Studio
Setting Up Kotlin in Android Studio
● Extremely easy setup for both major versions of AS
● Plugin for AS 2.3.X
○ Preferences > Plugins > Install JetBrains Plugin
● Baked-in support in AS 3.0.0 (beta)
○ Also includes:
■ A new profiler tool
■ A network/request analyzer (!)
Installing the plugin for AS 2.3.X
Kotlin: The Basics
Kotlin: The Basics - Variable Declarations
Kotlin: The Basics - Function Declarations
Kotlin: The Basics - Class Declarations
Kotlin: The Cool Parts
Kotlin: The Cool Parts - Data Classes (http://bit.ly/2xhvVlh)
Kotlin: The Cool Parts - Elvis Operator
Kotlin: The Cool Parts - Extension Functions
Kotlin: The Cool Parts - Named and Default Arguments
Kotlin: The Cool Parts - When
Kotlin: The Cool Parts - Operator Overloading
Kotlin: The Cool Parts - Object Desctructuring
Kotlin: The Cool Parts - Custom Infix Operators
Kotlin: The Cool Parts - And Much More!
● Lambda functions
● Easier string interpolation
● Simplified getter/setter syntax
● Coroutines
● “Synthetic” plugin to replace findViewById (similar to Butterknife)
Converting Java to Kotlin
Converting Java to Kotlin - Using the Converter
Converting Java to Kotlin - Double Bangs
Converting Java to Kotlin - Companion Objects
Drawbacks To Kotlin
Drawbacks To Kotlin
● It’s new
○ Initial development with Kotlin will be slower
○ Code patterns/anti-patterns not fully flushed out yet
● Java has more robust static analysis tools
● Much smaller developer community than Java’s
● Adds ~727kB to the total size of your project
Over time the benefits
of using Kotlin will
continue to grow.
Give it a try!
Thank you!
Twitter: @adammagana
GitHub: @adammagana

More Related Content

What's hot (20)

PDF
Kotlin - Better Java
Dariusz Lorenc
 
PDF
Android 101 - Kotlin ( Future of Android Development)
Hassan Abid
 
PPT
The Kotlin Programming Language
intelliyole
 
PDF
A quick and fast intro to Kotlin
XPeppers
 
PPTX
Introduction to Koltin for Android Part I
Atif AbbAsi
 
PDF
Kotlin: Why Do You Care?
intelliyole
 
PDF
Kotlin: Challenges in JVM language design
Andrey Breslav
 
PDF
Kotlin boost yourproductivity
nklmish
 
PDF
Kotlin Slides from Devoxx 2011
Andrey Breslav
 
PDF
Taking Kotlin to production, Seriously
Haim Yadid
 
PDF
Kotlin a problem solver - gdd extended pune
Hardik Trivedi
 
PPTX
Fall in love with Kotlin
Hari Vignesh Jayapalan
 
PDF
Swift and Kotlin Presentation
Andrzej Sitek
 
PDF
Kotlin in action
Ciro Rizzo
 
PDF
Kotlin cheat sheet by ekito
Arnaud Giuliani
 
PDF
Kotlin, smarter development for the jvm
Arnaud Giuliani
 
PDF
Develop your next app with kotlin @ AndroidMakersFr 2017
Arnaud Giuliani
 
PPTX
Kotlin
Rory Preddy
 
ODP
From object oriented to functional domain modeling
Codemotion
 
PDF
Kotlin intro
Elifarley Cruz
 
Kotlin - Better Java
Dariusz Lorenc
 
Android 101 - Kotlin ( Future of Android Development)
Hassan Abid
 
The Kotlin Programming Language
intelliyole
 
A quick and fast intro to Kotlin
XPeppers
 
Introduction to Koltin for Android Part I
Atif AbbAsi
 
Kotlin: Why Do You Care?
intelliyole
 
Kotlin: Challenges in JVM language design
Andrey Breslav
 
Kotlin boost yourproductivity
nklmish
 
Kotlin Slides from Devoxx 2011
Andrey Breslav
 
Taking Kotlin to production, Seriously
Haim Yadid
 
Kotlin a problem solver - gdd extended pune
Hardik Trivedi
 
Fall in love with Kotlin
Hari Vignesh Jayapalan
 
Swift and Kotlin Presentation
Andrzej Sitek
 
Kotlin in action
Ciro Rizzo
 
Kotlin cheat sheet by ekito
Arnaud Giuliani
 
Kotlin, smarter development for the jvm
Arnaud Giuliani
 
Develop your next app with kotlin @ AndroidMakersFr 2017
Arnaud Giuliani
 
Kotlin
Rory Preddy
 
From object oriented to functional domain modeling
Codemotion
 
Kotlin intro
Elifarley Cruz
 

Similar to Say Goodbye To Java: Getting Started With Kotlin For Android Development (20)

PDF
Kotlin for Android
Han Yin
 
PDF
Learn Kotlin and Build Robust Android Apps with Bcoder.pdf
Bcoder Dev
 
PPTX
Introduction to Kotlin
T.M. Ishrak Hussain
 
PPTX
Why to Choose Kotlin in 2023 to Build Mobile Apps Faster?
9 series
 
PPTX
Kotlin – Alternative oder Ergänzung zu Java?
gedoplan
 
PDF
Introduction to Kotlin - Android KTX
Syed Awais Mazhar Bukhari
 
PDF
Developers’ mDay u Banjoj Luci - Duško Bajić, Kotlin User Group Bosnia – Kotl...
mCloud
 
PPTX
Dev Catchup @ARQGroup
Karan Sharma
 
PDF
Kotlin vs Java: Choosing The Right Language
FredReynolds2
 
PPTX
Android with kotlin course
Abdul Rahman Masri Attal
 
PPTX
Android Development with Kotlin course
GoogleDevelopersLeba
 
PDF
Kotlin App Development Tips.pdf
Marie Weaver
 
PPTX
Desarrollo multiplataforma con kotlin | UPV 2018
Víctor Bolinches
 
PDF
Why You Should Go with Kotlin for Android App Development.pdf
RipenApps
 
PPTX
What's new with Kotlin - Google IO18' extended Covenant University.
SimileoluwaAluko
 
PPTX
8 Reasons to Pick Kotlin Over Java for Android Development.pptx
Elsner Technologies Pvt. Ltd.
 
PDF
Kotlin vs Java-A Comparison for Application Development Projects.pdf
Techugo
 
PDF
Kotlin vs Java | A Comparative Analysis | IDEA USHER
Nitish Garg
 
PPTX
AOT(Ahead Of Time)
Questpond
 
Kotlin for Android
Han Yin
 
Learn Kotlin and Build Robust Android Apps with Bcoder.pdf
Bcoder Dev
 
Introduction to Kotlin
T.M. Ishrak Hussain
 
Why to Choose Kotlin in 2023 to Build Mobile Apps Faster?
9 series
 
Kotlin – Alternative oder Ergänzung zu Java?
gedoplan
 
Introduction to Kotlin - Android KTX
Syed Awais Mazhar Bukhari
 
Developers’ mDay u Banjoj Luci - Duško Bajić, Kotlin User Group Bosnia – Kotl...
mCloud
 
Dev Catchup @ARQGroup
Karan Sharma
 
Kotlin vs Java: Choosing The Right Language
FredReynolds2
 
Android with kotlin course
Abdul Rahman Masri Attal
 
Android Development with Kotlin course
GoogleDevelopersLeba
 
Kotlin App Development Tips.pdf
Marie Weaver
 
Desarrollo multiplataforma con kotlin | UPV 2018
Víctor Bolinches
 
Why You Should Go with Kotlin for Android App Development.pdf
RipenApps
 
What's new with Kotlin - Google IO18' extended Covenant University.
SimileoluwaAluko
 
8 Reasons to Pick Kotlin Over Java for Android Development.pptx
Elsner Technologies Pvt. Ltd.
 
Kotlin vs Java-A Comparison for Application Development Projects.pdf
Techugo
 
Kotlin vs Java | A Comparative Analysis | IDEA USHER
Nitish Garg
 
AOT(Ahead Of Time)
Questpond
 
Ad

Recently uploaded (20)

PPTX
MailsDaddy Outlook OST to PST converter.pptx
abhishekdutt366
 
PDF
Continouous failure - Why do we make our lives hard?
Papp Krisztián
 
PDF
iTop VPN With Crack Lifetime Activation Key-CODE
utfefguu
 
PPTX
3uTools Full Crack Free Version Download [Latest] 2025
muhammadgurbazkhan
 
PPT
MergeSortfbsjbjsfk sdfik k
RafishaikIT02044
 
PDF
HiHelloHR – Simplify HR Operations for Modern Workplaces
HiHelloHR
 
PPTX
How Apagen Empowered an EPC Company with Engineering ERP Software
SatishKumar2651
 
PDF
GetOnCRM Speeds Up Agentforce 3 Deployment for Enterprise AI Wins.pdf
GetOnCRM Solutions
 
PDF
Why Businesses Are Switching to Open Source Alternatives to Crystal Reports.pdf
Varsha Nayak
 
PPTX
Perfecting XM Cloud for Multisite Setup.pptx
Ahmed Okour
 
PPTX
Platform for Enterprise Solution - Java EE5
abhishekoza1981
 
PDF
Letasoft Sound Booster 1.12.0.538 Crack Download+ Product Key [Latest]
HyperPc soft
 
PPTX
Engineering the Java Web Application (MVC)
abhishekoza1981
 
PPTX
An Introduction to ZAP by Checkmarx - Official Version
Simon Bennetts
 
PDF
vMix Pro 28.0.0.42 Download vMix Registration key Bundle
kulindacore
 
PDF
Mobile CMMS Solutions Empowering the Frontline Workforce
CryotosCMMSSoftware
 
PPTX
Tally_Basic_Operations_Presentation.pptx
AditiBansal54083
 
PPTX
Writing Better Code - Helping Developers make Decisions.pptx
Lorraine Steyn
 
PDF
Understanding the Need for Systemic Change in Open Source Through Intersectio...
Imma Valls Bernaus
 
PDF
GridView,Recycler view, API, SQLITE& NetworkRequest.pdf
Nabin Dhakal
 
MailsDaddy Outlook OST to PST converter.pptx
abhishekdutt366
 
Continouous failure - Why do we make our lives hard?
Papp Krisztián
 
iTop VPN With Crack Lifetime Activation Key-CODE
utfefguu
 
3uTools Full Crack Free Version Download [Latest] 2025
muhammadgurbazkhan
 
MergeSortfbsjbjsfk sdfik k
RafishaikIT02044
 
HiHelloHR – Simplify HR Operations for Modern Workplaces
HiHelloHR
 
How Apagen Empowered an EPC Company with Engineering ERP Software
SatishKumar2651
 
GetOnCRM Speeds Up Agentforce 3 Deployment for Enterprise AI Wins.pdf
GetOnCRM Solutions
 
Why Businesses Are Switching to Open Source Alternatives to Crystal Reports.pdf
Varsha Nayak
 
Perfecting XM Cloud for Multisite Setup.pptx
Ahmed Okour
 
Platform for Enterprise Solution - Java EE5
abhishekoza1981
 
Letasoft Sound Booster 1.12.0.538 Crack Download+ Product Key [Latest]
HyperPc soft
 
Engineering the Java Web Application (MVC)
abhishekoza1981
 
An Introduction to ZAP by Checkmarx - Official Version
Simon Bennetts
 
vMix Pro 28.0.0.42 Download vMix Registration key Bundle
kulindacore
 
Mobile CMMS Solutions Empowering the Frontline Workforce
CryotosCMMSSoftware
 
Tally_Basic_Operations_Presentation.pptx
AditiBansal54083
 
Writing Better Code - Helping Developers make Decisions.pptx
Lorraine Steyn
 
Understanding the Need for Systemic Change in Open Source Through Intersectio...
Imma Valls Bernaus
 
GridView,Recycler view, API, SQLITE& NetworkRequest.pdf
Nabin Dhakal
 
Ad

Say Goodbye To Java: Getting Started With Kotlin For Android Development

  • 1. Say Goodbye to Java: Getting Started With Kotlin for Android Adam Magaña
  • 3. Introduction ● Adam Magaña ● Lead Mobile Engineer @ Drund ● Currently spending most of my development time working on our Android application.
  • 4. A Quick History of Kotlin
  • 5. A Quick History of Kotlin ● Created by JetBrains ○ Creator of IntelliJ, the IDE that powers Android Studio ● First release - July 2011 ● Latest release (1.1.3) - June 2017 ● Official endorsement by Google as first-class language - May 2017 ● 8,000+ total releases on GitHub
  • 6. “We believe Kotlin is an excellent fit for Android not only because it gives developers what they want, but also because it matches the spirit of Android.” - Google Developer Product Group
  • 8. Companies Using Kotlin ● Pinterest ● Netflix ● AWS ● Uber ● Square ● Trello
  • 9. 10% Reduction in total methods after converting Basecamp to Kotlin.
  • 10. 30% Reduction in total lines of code after converting Basecamp to Kotlin.
  • 12. “But I’m comfortable and experienced with Java.” ● That’s great! ● You ultimately have to use what you’re most comfortable with. ● BUT “give it 5 minutes” before reacting.
  • 13. “I don’t want to convert my entire codebase to a new language.” ● Kotlin can be any percentage of your project. ● Fully compatible with JDK 6. ● 100% interoperable with existing Java code.
  • 14. “I don’t need Kotlin’s special tools to get the job done.” ● An experienced developer absolutely doesn’t need Kotlin. ● Much can be accomplished with Java. ● BUT barring architectural/performance issues, why would you want to have less tools available to you?
  • 15. “I’m worried about the performance implications of using Kotlin.” ● Performance is as good as an equivalent Java application. ● Kotlin lambdas often run faster than the same code written in Java. ● Incremental project builds using Kotlin are usually faster.
  • 16. A Very Small Soapbox
  • 17. A Very Small Soapbox ● Don’t let anyone, myself included, make you feel inadequate for choosing a different programming language or platform than them. ● Will there be better alternatives to what you use? Yes. ● Does that mean the service you provide to your users is sub-par? No. ● Is it okay to have differing opinions about certain technologies? Absolutely. ● Important to be supportive.
  • 18. We’re all in this together.
  • 19. Setting Up Kotlin in Android Studio
  • 20. Setting Up Kotlin in Android Studio ● Extremely easy setup for both major versions of AS ● Plugin for AS 2.3.X ○ Preferences > Plugins > Install JetBrains Plugin ● Baked-in support in AS 3.0.0 (beta) ○ Also includes: ■ A new profiler tool ■ A network/request analyzer (!)
  • 21. Installing the plugin for AS 2.3.X
  • 23. Kotlin: The Basics - Variable Declarations
  • 24. Kotlin: The Basics - Function Declarations
  • 25. Kotlin: The Basics - Class Declarations
  • 27. Kotlin: The Cool Parts - Data Classes (http://bit.ly/2xhvVlh)
  • 28. Kotlin: The Cool Parts - Elvis Operator
  • 29. Kotlin: The Cool Parts - Extension Functions
  • 30. Kotlin: The Cool Parts - Named and Default Arguments
  • 31. Kotlin: The Cool Parts - When
  • 32. Kotlin: The Cool Parts - Operator Overloading
  • 33. Kotlin: The Cool Parts - Object Desctructuring
  • 34. Kotlin: The Cool Parts - Custom Infix Operators
  • 35. Kotlin: The Cool Parts - And Much More! ● Lambda functions ● Easier string interpolation ● Simplified getter/setter syntax ● Coroutines ● “Synthetic” plugin to replace findViewById (similar to Butterknife)
  • 37. Converting Java to Kotlin - Using the Converter
  • 38. Converting Java to Kotlin - Double Bangs
  • 39. Converting Java to Kotlin - Companion Objects
  • 41. Drawbacks To Kotlin ● It’s new ○ Initial development with Kotlin will be slower ○ Code patterns/anti-patterns not fully flushed out yet ● Java has more robust static analysis tools ● Much smaller developer community than Java’s ● Adds ~727kB to the total size of your project
  • 42. Over time the benefits of using Kotlin will continue to grow.
  • 43. Give it a try!

Editor's Notes

  • #9: Highly recommend the pinterest engineering blog for insights on how they use Kotlin
  • #11: Dan Kim, Basecamp, developer happiness Overheard Nick talk about Ruby Dan compares Kotlin it to the way people feel about Ruby
  • #28: Made for classes are strictly used as data containers.