SlideShare a Scribd company logo
Kotlin for Android
Prepared by Shady Selim
For GDG 6 October Google I/O 17 Event
On 8/7/2017
Speaker Bio
• Official Google Speaker
• GDG Helwan Founder & Leader
• Mobile & Web Evangelist
• Technology savvy
• Think tank, Father
• UI/UX freak
• Leader & Mentor
www.linkedin.com/in/shadyselim/
@dr_Shady_Selim
2
Who created Kotlin?
• IntelliJ IDEA
• PhpStorm
• ReSharper
• PyCharm
• RubyMine
• … others
3
What is Kotlin?
4
Why Kotlin Now?
5
6
Is Kotlin Really new?
7
Why Should I care!!?
• Statically typed programming language targeting the JVM
• Support for functional and OO paradigms
• Pragmatic, safe, concise, great Java interop
• Free and open-source
• Drastically reduce the amount of boilerplate code
• Lambda expression
• Avoid entire classes of errors such as null pointer exceptions
• Java 9 is …
8
The Strengths of Kotlin
• Modeling the data of your application concisely and expressively
• Creating reusable abstractions using functional programming
techniques
• Creating expressive domain-specific languages
• Java interop ensures that all existing Java frameworks can be used
• No rewrite required to start using Kotlin in existing codebase
• Existing investment is fully preserved
9
Java Model Example
10
public class Customer {
private String name;
private String email;
private String company;
public Customer(String name) {
this(name, "", "");
}
public Customer(String name, String email) {
this(name, email, "");
}
public Customer(String name, String email, String company) {
this.name = name;
this.email = email;
this.company = company;
}
Java Model Example, cont.
11
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
Java Model Example, cont.
12
public String getCompany() {
return company;
}
public void setCompany(String company) {
this.company = company;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Customer customer = (Customer) o;
if (name != null ? !name.equals(customer.name) : customer.name != null) return false;
if (email != null ? !email.equals(customer.email) : customer.email != null) return false;
return company != null ? company.equals(customer.company) : customer.company == null;
}
Java Model Example, cont.
13
@Override
public int hashCode() {
int result = name != null ? name.hashCode() : 0;
result = 31 * result + (email != null ? email.hashCode() : 0);
result = 31 * result + (company != null ? company.hashCode() : 0);
return result;
}
@Override
public String toString() {
return "Customer{" +
"name='" + name + ''' +
", email='" + email + ''' +
", company='" + company + ''' +
'}';
}
}
Kotlin Model Example, cont.
14
data class Customer(var name: String,
var email: String = "",
var company: String = "")
Do you like reactive programming?
15
You will not miss your frameworks or libraries
16
You will not miss your frameworks or libraries
17
kotlin.link
18
Resources
• https://kotlinlang.org/
• https://m.signalvnoise.com/kotlin-its-the-little-things-8c0f501bc6ea
• https://www.jetbrains.com/
• https://www.slideshare.net/intelliyole/kotlin-why-do-you-care
• https://github.com/ReactiveX/RxKotlin
• https://spring.io/blog/2016/02/15/developing-spring-boot-
applications-with-kotlin
• https://www.slideshare.net/makingx/spring-kotlin
• https://kotlin.link/
19
Questions!?
20

More Related Content

PPTX
Intro to Kotlin
PPSX
Kotlin Language powerpoint show file
PPTX
Intro to Kotlin
PPTX
Intro to Kotlin Minia GDG DevFest 2017
PPTX
Android with kotlin course
PDF
Is this Swift for Android? A short introduction to the Kotlin language
PDF
Programming with Kotlin
Intro to Kotlin
Kotlin Language powerpoint show file
Intro to Kotlin
Intro to Kotlin Minia GDG DevFest 2017
Android with kotlin course
Is this Swift for Android? A short introduction to the Kotlin language
Programming with Kotlin

What's hot (20)

PPTX
Kotlin L → ∞
PDF
Slides kotlin yajug
PDF
Kotlin & arrow: the functional way
PDF
Kotlin introduction
PDF
Kotlin & Arrow the functional way
PPTX
Coding in kotlin
PPTX
Kotlin - A Programming Language
PDF
[Kotlin勉強会] Hello Kotlinの次におさえたいKotlinの勘所
PDF
Golang #5: To Go or not to Go
PDF
Log cat kotlindsl
PDF
Introduction to Kotlin coroutines
PDF
[INNOVATUBE] Tech Talk #3: Golang - Takaaki Mizuno
PPT
Smoothing Your Java with DSLs
PPTX
Hello to Kotlin
PDF
A Brief Overview of Kotlin
PDF
Internal domain-specific languages
PDF
How to contribute textual tooling for apache camel in several id es
PPTX
Agile Tools for PHP
PDF
Implementing DSLs in practice
PPTX
Coffee scripts with rails
Kotlin L → ∞
Slides kotlin yajug
Kotlin & arrow: the functional way
Kotlin introduction
Kotlin & Arrow the functional way
Coding in kotlin
Kotlin - A Programming Language
[Kotlin勉強会] Hello Kotlinの次におさえたいKotlinの勘所
Golang #5: To Go or not to Go
Log cat kotlindsl
Introduction to Kotlin coroutines
[INNOVATUBE] Tech Talk #3: Golang - Takaaki Mizuno
Smoothing Your Java with DSLs
Hello to Kotlin
A Brief Overview of Kotlin
Internal domain-specific languages
How to contribute textual tooling for apache camel in several id es
Agile Tools for PHP
Implementing DSLs in practice
Coffee scripts with rails
Ad

Similar to Kotlin for android (20)

PPTX
Intro to kotlin 2018
PDF
Kotlin mufix 31 10-2019 by Ahmed Nabil(AhmedNMahran)
PDF
JavaCro'14 - Is there Kotlin after Java 8 – Ivan Turčinović and Igor Buzatović
PPTX
Kotlin for all the Things
PDF
A quick and fast intro to Kotlin
PPTX
Kotlin for android
PPTX
Introduction to Kotlin Language and its application to Android platform
PDF
Be More Productive with Kotlin
PDF
Having Fun with Kotlin Android - DILo Surabaya
PDF
Kotlin what_you_need_to_know-converted event 4 with nigerians
PDF
Introduction to kotlin for Java Developer
PPTX
Why kotlininandroid
PDF
Kotlin for Android Developers - 1
PDF
Kotlin: A pragmatic language by JetBrains
PDF
JDD 2017: Kotlin for Java developers (Tomasz Kleszczyński)
PDF
Android 101 - Kotlin ( Future of Android Development)
PPTX
Kotlin: lo Swift di Android (2015)
PPTX
Kotlin – the future of android
PPTX
Kotlin Native - C / Swift Interop - ACCU Autmn 2019
PDF
Dear Kotliners - Java Developers are Humans too
Intro to kotlin 2018
Kotlin mufix 31 10-2019 by Ahmed Nabil(AhmedNMahran)
JavaCro'14 - Is there Kotlin after Java 8 – Ivan Turčinović and Igor Buzatović
Kotlin for all the Things
A quick and fast intro to Kotlin
Kotlin for android
Introduction to Kotlin Language and its application to Android platform
Be More Productive with Kotlin
Having Fun with Kotlin Android - DILo Surabaya
Kotlin what_you_need_to_know-converted event 4 with nigerians
Introduction to kotlin for Java Developer
Why kotlininandroid
Kotlin for Android Developers - 1
Kotlin: A pragmatic language by JetBrains
JDD 2017: Kotlin for Java developers (Tomasz Kleszczyński)
Android 101 - Kotlin ( Future of Android Development)
Kotlin: lo Swift di Android (2015)
Kotlin – the future of android
Kotlin Native - C / Swift Interop - ACCU Autmn 2019
Dear Kotliners - Java Developers are Humans too
Ad

More from Shady Selim (20)

PPTX
What is Kotlin Multiplaform? Why & How?
PDF
Kotlin native for iOS and Android
PPTX
Introduction on Mobile development
PDF
Game development using Flutter
PPTX
I/O 2019 android updates
PPTX
Kotlin for android 2019
PPTX
What's new in android 2018 (dev fest)
PPTX
Intro to Flutter
PDF
The magic of flutter
PPTX
Kotlin for Frontend & Backend Web development
PPTX
Firebase
PPTX
Android content provider explained
PPTX
Design for Web and Mobile
PPTX
Towards a better higher education system by Shady Selim
DOCX
Android Programing Course Material Labs
DOCX
Android Programing Course Material
PPTX
Cross mobility
PPTX
Mobile apps types + Responsice Vs. Adaptive
PPTX
Grow your business with player analytics ben frenkel & Shady Selim
DOC
Shady's CV 2014
What is Kotlin Multiplaform? Why & How?
Kotlin native for iOS and Android
Introduction on Mobile development
Game development using Flutter
I/O 2019 android updates
Kotlin for android 2019
What's new in android 2018 (dev fest)
Intro to Flutter
The magic of flutter
Kotlin for Frontend & Backend Web development
Firebase
Android content provider explained
Design for Web and Mobile
Towards a better higher education system by Shady Selim
Android Programing Course Material Labs
Android Programing Course Material
Cross mobility
Mobile apps types + Responsice Vs. Adaptive
Grow your business with player analytics ben frenkel & Shady Selim
Shady's CV 2014

Recently uploaded (20)

PDF
Encapsulation theory and applications.pdf
PPTX
Cloud computing and distributed systems.
PDF
Spectral efficient network and resource selection model in 5G networks
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Empathic Computing: Creating Shared Understanding
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Machine learning based COVID-19 study performance prediction
PDF
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
PDF
CIFDAQ's Market Insight: SEC Turns Pro Crypto
PDF
Electronic commerce courselecture one. Pdf
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
NewMind AI Monthly Chronicles - July 2025
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
Chapter 3 Spatial Domain Image Processing.pdf
Encapsulation theory and applications.pdf
Cloud computing and distributed systems.
Spectral efficient network and resource selection model in 5G networks
Digital-Transformation-Roadmap-for-Companies.pptx
Diabetes mellitus diagnosis method based random forest with bat algorithm
Advanced methodologies resolving dimensionality complications for autism neur...
Empathic Computing: Creating Shared Understanding
Dropbox Q2 2025 Financial Results & Investor Presentation
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Machine learning based COVID-19 study performance prediction
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
CIFDAQ's Market Insight: SEC Turns Pro Crypto
Electronic commerce courselecture one. Pdf
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
NewMind AI Monthly Chronicles - July 2025
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Understanding_Digital_Forensics_Presentation.pptx
NewMind AI Weekly Chronicles - August'25 Week I
Chapter 3 Spatial Domain Image Processing.pdf

Kotlin for android

  • 1. Kotlin for Android Prepared by Shady Selim For GDG 6 October Google I/O 17 Event On 8/7/2017
  • 2. Speaker Bio • Official Google Speaker • GDG Helwan Founder & Leader • Mobile & Web Evangelist • Technology savvy • Think tank, Father • UI/UX freak • Leader & Mentor www.linkedin.com/in/shadyselim/ @dr_Shady_Selim 2
  • 3. Who created Kotlin? • IntelliJ IDEA • PhpStorm • ReSharper • PyCharm • RubyMine • … others 3
  • 6. 6
  • 8. Why Should I care!!? • Statically typed programming language targeting the JVM • Support for functional and OO paradigms • Pragmatic, safe, concise, great Java interop • Free and open-source • Drastically reduce the amount of boilerplate code • Lambda expression • Avoid entire classes of errors such as null pointer exceptions • Java 9 is … 8
  • 9. The Strengths of Kotlin • Modeling the data of your application concisely and expressively • Creating reusable abstractions using functional programming techniques • Creating expressive domain-specific languages • Java interop ensures that all existing Java frameworks can be used • No rewrite required to start using Kotlin in existing codebase • Existing investment is fully preserved 9
  • 10. Java Model Example 10 public class Customer { private String name; private String email; private String company; public Customer(String name) { this(name, "", ""); } public Customer(String name, String email) { this(name, email, ""); } public Customer(String name, String email, String company) { this.name = name; this.email = email; this.company = company; }
  • 11. Java Model Example, cont. 11 public String getName() { return name; } public void setName(String name) { this.name = name; } public String getEmail() { return email; } public void setEmail(String email) { this.email = email; }
  • 12. Java Model Example, cont. 12 public String getCompany() { return company; } public void setCompany(String company) { this.company = company; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Customer customer = (Customer) o; if (name != null ? !name.equals(customer.name) : customer.name != null) return false; if (email != null ? !email.equals(customer.email) : customer.email != null) return false; return company != null ? company.equals(customer.company) : customer.company == null; }
  • 13. Java Model Example, cont. 13 @Override public int hashCode() { int result = name != null ? name.hashCode() : 0; result = 31 * result + (email != null ? email.hashCode() : 0); result = 31 * result + (company != null ? company.hashCode() : 0); return result; } @Override public String toString() { return "Customer{" + "name='" + name + ''' + ", email='" + email + ''' + ", company='" + company + ''' + '}'; } }
  • 14. Kotlin Model Example, cont. 14 data class Customer(var name: String, var email: String = "", var company: String = "")
  • 15. Do you like reactive programming? 15
  • 16. You will not miss your frameworks or libraries 16
  • 17. You will not miss your frameworks or libraries 17
  • 19. Resources • https://kotlinlang.org/ • https://m.signalvnoise.com/kotlin-its-the-little-things-8c0f501bc6ea • https://www.jetbrains.com/ • https://www.slideshare.net/intelliyole/kotlin-why-do-you-care • https://github.com/ReactiveX/RxKotlin • https://spring.io/blog/2016/02/15/developing-spring-boot- applications-with-kotlin • https://www.slideshare.net/makingx/spring-kotlin • https://kotlin.link/ 19