SlideShare a Scribd company logo
Develop a
weather app
with K
Schedule
9:00 - Introduction

9:05 - Intro to Kotlin part 1

9:25 - Project presentation & setup

9:35 - Hands-on part 1 (55 minutes)

10:30 - Coffee break 

10:45 - Intro to Kotlin part 2

11:00 - Hands-on part 2 (55 minutes)

11:55 - Final Part
#androiddev #kotlin #morningtech @ekito
Practical notes
https://github.com/Ekito/2017-handson-kotlinAndroid
Grab your stuff !
#androiddev #kotlin #morningtech @ekito
@Baresse
Work @ ekito
Developer & Geek
Fullstack & MobileLaurent BARESSE
@arnogiu
Work @ ekito
Core & Gear Maker
Mobile & CloudArnaud GIULIANI
#androiddev #kotlin #morningtech @ekito
https://www.ekito.fr/careers
Join the team !
#androiddev #kotlin #morningtech @ekito
Intro to
part 1
#androiddev #kotlin #morningtech @ekito
« production ready »
15.02.2016
#androiddev #kotlin #morningtech @ekito
#androiddev #kotlin #morningtech @ekito
Kotlin 1.1.1 @ 15.03.2017
Yet another JVM
Language ?
#androiddev #kotlin #morningtech @ekito
The new « Swift »
for Android ?
#androiddev #kotlin #morningtech @ekito
#androiddev #kotlin #morningtech @ekito
What’s
Kotlin ?
- Fully open source (built by Jetbrains)
- Run on Java 6+
- Static typing & type inference
- Modern language features
- 1st grade tooling
#androiddev #kotlin #morningtech @ekito
How K can help
you ?
- Conciseness
- Null Safety & Immutability protection
- Static Typing & Smart Casts
- Open programming styles (lambdas, high order functions …)
- Java Interop
#androiddev #kotlin #morningtech @ekito
More About
Kotlin …
- String templates
- Properties
- Lambdas
- Data class
- Smart cast
- Null safety
- Lazy property
- Default values for function
parameters
- Extension Functions
- No more ;
- Single-expression
functions
- When expression
- let, apply, use, with
- Collections
- Android Extensions Plugin
#androiddev #kotlin #morningtech @ekito
Compare with
Same conciseness and expressive code, but
Kotlin static typing and null-safety make a big
difference.
"Some people say Kotlin has 80% the power of
Scala, with 20% of the features" * 

"Kotlin is a software engineering language in
contrast to Scala which is a computing science
language." *
Swift and Kotlin are VERY similar. Swift is LLVM
based and has C interop while Kotlin is JVM based
and has Java interop.
* Quotes from Kotlin:TheYing andYang of Programming Languages
#androiddev #kotlin #morningtech @ekito
@
sdeleuze
is Kotlin Android friendly ?
https://github.com/SidneyXu/AndroidDemoIn4Languages
Method counts by Language
#androiddev #kotlin #morningtech @ekito
KOTLIN is not just about writing
your app with lesser lines.
It’s all about writing
SAFER & BETTER APPS !
#androiddev #kotlin #morningtech @ekito
18
Let’s Go !
#androiddev #kotlin #morningtech @ekito
Typing & Inference
val a: Int = 1

val b = 1 // `Int` type is inferred
var x = 5 // `Int` type is inferred

x += 1
Inferred values
Mutable values
val : constant value - IMMUTABLE
var : variable value - MUTABLE
USE VAL AS MUCH AS POSSIBLE !
#androiddev #kotlin #morningtech @ekito
Safety with Optionals
var stringA: String = "foo"

stringA = null //Compilation error - stringA is a String (non optional)



var stringB: String? = "bar" // stringB is an Optional String

stringB = null //ok
Optional value
#androiddev #kotlin #morningtech @ekito
// set length default value manually

val length = if (stringB != null) stringB.length else -1

//or with the Elvis operator

val length = stringB?.length ?: -1
DefaultValue & Elvis Operator
val length = stringB.length // Compilation error - stringB can be null !

// use ? the safe call operator

val length = stringB?.length //Value or null - length is type Int?
val length = stringB!!.length //Value or explicit throw NPE - length is type Int
Safe call with ?. or Explicit call with !!.
#androiddev #kotlin #morningtech @ekito
Example
Working with optional values
#androiddev #kotlin #morningtech @ekito
Example
Null check safety & Smart cast
Securing with default values
#androiddev #kotlin #morningtech @ekito
Class
class User (

val userName: String,

val firstName: String,

val lastName: String,

var location: Point? = null

)
POJO +
- Getter
- Setter
- Constructors
public / closed by default
#androiddev #kotlin #morningtech @ekito
Data Class
data class User (

val userName: String,

val firstName: String,

val lastName: String,

var location: Point? = null

)
POJO +
- Getter
- Setter
- Constructors
- toString
- hashcode
- equals
- copy
#androiddev #kotlin #morningtech @ekito
POJO ?
Kotlin
Java
#androiddev #kotlin #morningtech @ekito
Properties
// readonly property

val isEmpty: Boolean

get() = this.size == 0
Properties can be declared in constructor or in class
You can also handle getter & setter
// customer getter & setter

var stringRepresentation: String
set(value) {

…
}
class ApiKey(var weatherKey: String, var geocodeKey: String){

var debug : Boolean = false

}
* Late initialization, Lazy, Delegates …
#androiddev #kotlin #morningtech @ekito
Example
data class User(val name: String = "", val age: Int = 0)
val jack = User(name = "Jack", age = 1) //no new keyword

val anotherJack = jack.copy(age = 2)
Data Class usage
A simple GSon Class
#androiddev #kotlin #morningtech @ekito
Object Class
// singleton

object Resource {

val name = "Name"

}
class StringCalculator{
// class helper

companion object{

val operators = arrayOf("+","-","x","/")

}

}
Singleton Class
Companion Object
#androiddev #kotlin #morningtech @ekito
When
in <range> ->
is <type> ->
expression ->
when (s) {

1 -> print("x == 1")

2 -> print("x == 2")

else -> { // Note the block

print("x is neither 1 nor 2")

}

}
Flow Control (replace your old if blocks)
when (x) {

in 1..10 -> print("x is in the range")

in validNumbers -> print("x is valid")

!in 10..20 -> print("x is outside the range")

else -> print("none of the above")

}
Pattern Matching
* can match with operators : in, as, is, range …
#androiddev #kotlin #morningtech @ekito
Example
Android Page Adapter
Pattern Matching
#androiddev #kotlin #morningtech @ekito
Collections
// immutable map

val map = mapOf("a" to 1, "b" to 2, "c" to 3)

for ((k, v) in map) {

println("$k -> $v")

}


map2["a"] = "my value" // direct map access with array style
// range

for (i in 1..100) { //... }
// immutable list

val list = listOf("a", "b", "c","aa")

list.filter { it.startsWith("a") }
* collections operators : map, filter, take, flatMap, forEach, firstOrNull, last …
#androiddev #kotlin #morningtech @ekito
Example
Kotlin Collection
Java 7 Collection
#androiddev #kotlin #morningtech @ekito
InterOp Java/Kotlin
object UserSingleton{

fun stringify(user : User) : String{

// …

}

}
fun WhatIsyourAge(user : User){

println("Your age is ${user.age}")

}
data class User (val name: String, val age : Int){

companion object{

fun sayHello(user : User){
//…

}

}

}
User u = new User("toto",42);

User.Companion.sayHello(u);
UserUtilsKt.WhatIsyourAge(u);
UserSingleton.INSTANCE.stringify(u)
#androiddev #kotlin #morningtech @ekito
Project presentation
& setup
#androiddev #kotlin #morningtech @ekito
My Weather app
#androiddev #kotlin #morningtech @ekito
Get the project
#androiddev #kotlin #morningtech @ekito
https://github.com/Ekito/2017-handson-kotlinAndroid
Create your branch
#androiddev #kotlin #morningtech @ekito
https://github.com/Ekito/2017-handson-kotlinAndroid/blob/master/README.pdf
MainApplication MainActivity
DailyForecastModel
DialogHelper
WeatherSDKUtil
WeatherSDK
#androiddev #kotlin #morningtech @ekito
Hands-on
part 1
#androiddev #kotlin #morningtech @ekito
9:00 - Introduction

9:05 - Intro to Kotlin part 1

9:25 - Project presentation & setup

9:35 - Hands-on part 1 (55 minutes)
10:30 - Coffee break 

10:45 - Intro to Kotlin part 2

11:00 - Hands-on part 2 (55 minutes)

11:55 - Final Part
Hands-on !
#androiddev #kotlin #morningtech @ekito
9:00 - Introduction

9:05 - Intro to Kotlin part 1

9:25 - Project presentation & setup

9:35 - Hands-on part 1 (55 minutes)

10:30 - Coffee break
10:45 - Intro to Kotlin part 2

11:00 - Hands-on part 2 (55 minutes)

11:55 - Final Part
#androiddev #kotlin #morningtech @ekito
Coffee Break !
Intro to
part 2
#androiddev #kotlin #morningtech @ekito
Sweet stuffs for
#androiddev #kotlin #morningtech @ekito
Kotlin’s Android
Extensions
apply plugin: 'com.android.application'
apply plugin:‘kotlin-android’
apply plugin:‘kotlin-android-extensions’ // if use extensions
In your build.gradle
#androiddev #kotlin #morningtech @ekito
Kotlin
Java
#androiddev #kotlin #morningtech @ekito
* In Fragment : onViewCreated()
Lambdas
val fab = findViewById(R.id.fab) as FloatingActionButton

fab.setOnClickListener { view -> popLocationDialog(view) }
A lambda expression or an anonymous function is a “function literal”, i.e. a function that is
not declared, but passed immediately as an expression
- A lambda expression is always surrounded by curly braces
- Its parameters (if any) are declared before -> (parameter types may be omitted),
- The body goes after -> (when present).
myNumber.split("n").flatMap { it.split(separator) }

.map(Integer::parseInt)

.map(::checkPositiveNumber)

.filter { it <= 1000 }

.sum()
* Method references are not surrounded by curly braces !
#androiddev #kotlin #morningtech @ekito
Functions
fun reformat(str: String,

normalizeCase: Boolean = true,

upperCaseFirstLetter: Boolean = true,

wordSeparator: Char = ' '): String {



}
Named Parameters & default values
reformat(str, true, true, '_') // old way to call

reformat(str, wordSeparator = '_') // using default values & named params
#androiddev #kotlin #morningtech @ekito
Extensions Functions
Extension declaration
Usage
#androiddev #kotlin #morningtech @ekito
Reactive
Programming
#androiddev #kotlin #morningtech @ekito
Lamba expressions
Functional Programming
Reactive Streams
http://reactivex.io/documentation/operators.html
http://www.reactive-streams.org/
https://spring.io/blog/2016/06/07/notes-on-reactive-
programming-part-i-the-reactive-landscape
#androiddev #kotlin #morningtech @ekito
Example - Rx/Retrofit
Kotlin
Java
#androiddev #kotlin #morningtech @ekito
Hands-on
part 2
#androiddev #kotlin #morningtech @ekito
9:00 - Introduction

9:05 - Intro to Kotlin part 1

9:25 - Project presentation & setup

9:35 - Hands-on part 1 (55 minutes)

10:30 - Coffee break 

10:45 - Intro to Kotlin part 2

11:00 - Hands-on part 2 (55 minutes)
11:55 - Final Part
#androiddev #kotlin #morningtech @ekito
Hands-on !
Final Part
#androiddev #kotlin #morningtech @ekito
#androiddev #kotlin #morningtech @ekito
Time is over !
Smarter development for the JVM
Kotlin
#androiddev #kotlin #morningtech @ekito
Thank you for
coming
#androiddev #kotlin #morningtech @ekito

More Related Content

What's hot

Kotlin advanced - language reference for android developers
Kotlin advanced - language reference for android developersKotlin advanced - language reference for android developers
Kotlin advanced - language reference for android developers
Bartosz Kosarzycki
 
Kotlin
KotlinKotlin
Taking Kotlin to production, Seriously
Taking Kotlin to production, SeriouslyTaking Kotlin to production, Seriously
Taking Kotlin to production, Seriously
Haim Yadid
 
Introduction to kotlin for android app development gdg ahmedabad dev fest 2017
Introduction to kotlin for android app development   gdg ahmedabad dev fest 2017Introduction to kotlin for android app development   gdg ahmedabad dev fest 2017
Introduction to kotlin for android app development gdg ahmedabad dev fest 2017
Hardik Trivedi
 
Swift and Kotlin Presentation
Swift and Kotlin PresentationSwift and Kotlin Presentation
Swift and Kotlin Presentation
Andrzej Sitek
 
The Kotlin Programming Language, Svetlana Isakova
The Kotlin Programming Language, Svetlana IsakovaThe Kotlin Programming Language, Svetlana Isakova
The Kotlin Programming Language, Svetlana Isakova
Vasil Remeniuk
 
Kotlin boost yourproductivity
Kotlin boost yourproductivityKotlin boost yourproductivity
Kotlin boost yourproductivity
nklmish
 
Introduction to kotlin + spring boot demo
Introduction to kotlin + spring boot demoIntroduction to kotlin + spring boot demo
Introduction to kotlin + spring boot demo
Muhammad Abdullah
 
(How) can we benefit from adopting scala?
(How) can we benefit from adopting scala?(How) can we benefit from adopting scala?
(How) can we benefit from adopting scala?
Tomasz Wrobel
 
Little Helpers for Android Development with Kotlin
Little Helpers for Android Development with KotlinLittle Helpers for Android Development with Kotlin
Little Helpers for Android Development with Kotlin
Kai Koenig
 
Kotlin - Better Java
Kotlin - Better JavaKotlin - Better Java
Kotlin - Better Java
Dariusz Lorenc
 
Coding for Android on steroids with Kotlin
Coding for Android on steroids with KotlinCoding for Android on steroids with Kotlin
Coding for Android on steroids with Kotlin
Kai Koenig
 
The Kotlin Programming Language
The Kotlin Programming LanguageThe Kotlin Programming Language
The Kotlin Programming Language
intelliyole
 
Kotlin - The Swiss army knife of programming languages - Visma Mobile Meet-up...
Kotlin - The Swiss army knife of programming languages - Visma Mobile Meet-up...Kotlin - The Swiss army knife of programming languages - Visma Mobile Meet-up...
Kotlin - The Swiss army knife of programming languages - Visma Mobile Meet-up...
Tudor Dragan
 
eMan Dev Meetup: Kotlin - A Language we should know it exists (part 02/03) 18...
eMan Dev Meetup: Kotlin - A Language we should know it exists (part 02/03) 18...eMan Dev Meetup: Kotlin - A Language we should know it exists (part 02/03) 18...
eMan Dev Meetup: Kotlin - A Language we should know it exists (part 02/03) 18...
eMan s.r.o.
 
AST Transformations
AST TransformationsAST Transformations
AST Transformations
HamletDRC
 
K is for Kotlin
K is for KotlinK is for Kotlin
K is for Kotlin
TechMagic
 
Android antipatterns
Android antipatternsAndroid antipatterns
Android antipatterns
Bartosz Kosarzycki
 
Building native Android applications with Mirah and Pindah
Building native Android applications with Mirah and PindahBuilding native Android applications with Mirah and Pindah
Building native Android applications with Mirah and Pindah
Nick Plante
 

What's hot (19)

Kotlin advanced - language reference for android developers
Kotlin advanced - language reference for android developersKotlin advanced - language reference for android developers
Kotlin advanced - language reference for android developers
 
Kotlin
KotlinKotlin
Kotlin
 
Taking Kotlin to production, Seriously
Taking Kotlin to production, SeriouslyTaking Kotlin to production, Seriously
Taking Kotlin to production, Seriously
 
Introduction to kotlin for android app development gdg ahmedabad dev fest 2017
Introduction to kotlin for android app development   gdg ahmedabad dev fest 2017Introduction to kotlin for android app development   gdg ahmedabad dev fest 2017
Introduction to kotlin for android app development gdg ahmedabad dev fest 2017
 
Swift and Kotlin Presentation
Swift and Kotlin PresentationSwift and Kotlin Presentation
Swift and Kotlin Presentation
 
The Kotlin Programming Language, Svetlana Isakova
The Kotlin Programming Language, Svetlana IsakovaThe Kotlin Programming Language, Svetlana Isakova
The Kotlin Programming Language, Svetlana Isakova
 
Kotlin boost yourproductivity
Kotlin boost yourproductivityKotlin boost yourproductivity
Kotlin boost yourproductivity
 
Introduction to kotlin + spring boot demo
Introduction to kotlin + spring boot demoIntroduction to kotlin + spring boot demo
Introduction to kotlin + spring boot demo
 
(How) can we benefit from adopting scala?
(How) can we benefit from adopting scala?(How) can we benefit from adopting scala?
(How) can we benefit from adopting scala?
 
Little Helpers for Android Development with Kotlin
Little Helpers for Android Development with KotlinLittle Helpers for Android Development with Kotlin
Little Helpers for Android Development with Kotlin
 
Kotlin - Better Java
Kotlin - Better JavaKotlin - Better Java
Kotlin - Better Java
 
Coding for Android on steroids with Kotlin
Coding for Android on steroids with KotlinCoding for Android on steroids with Kotlin
Coding for Android on steroids with Kotlin
 
The Kotlin Programming Language
The Kotlin Programming LanguageThe Kotlin Programming Language
The Kotlin Programming Language
 
Kotlin - The Swiss army knife of programming languages - Visma Mobile Meet-up...
Kotlin - The Swiss army knife of programming languages - Visma Mobile Meet-up...Kotlin - The Swiss army knife of programming languages - Visma Mobile Meet-up...
Kotlin - The Swiss army knife of programming languages - Visma Mobile Meet-up...
 
eMan Dev Meetup: Kotlin - A Language we should know it exists (part 02/03) 18...
eMan Dev Meetup: Kotlin - A Language we should know it exists (part 02/03) 18...eMan Dev Meetup: Kotlin - A Language we should know it exists (part 02/03) 18...
eMan Dev Meetup: Kotlin - A Language we should know it exists (part 02/03) 18...
 
AST Transformations
AST TransformationsAST Transformations
AST Transformations
 
K is for Kotlin
K is for KotlinK is for Kotlin
K is for Kotlin
 
Android antipatterns
Android antipatternsAndroid antipatterns
Android antipatterns
 
Building native Android applications with Mirah and Pindah
Building native Android applications with Mirah and PindahBuilding native Android applications with Mirah and Pindah
Building native Android applications with Mirah and Pindah
 

Similar to Kotlin hands on - MorningTech ekito 2017

Geecon - Improve your Android-fu with Kotlin
Geecon - Improve your Android-fu with KotlinGeecon - Improve your Android-fu with Kotlin
Geecon - Improve your Android-fu with Kotlin
Nicolas Fränkel
 
Kotlin what_you_need_to_know-converted event 4 with nigerians
Kotlin  what_you_need_to_know-converted event 4 with nigeriansKotlin  what_you_need_to_know-converted event 4 with nigerians
Kotlin what_you_need_to_know-converted event 4 with nigerians
junaidhasan17
 
Android 101 - Kotlin ( Future of Android Development)
Android 101 - Kotlin ( Future of Android Development)Android 101 - Kotlin ( Future of Android Development)
Android 101 - Kotlin ( Future of Android Development)
Hassan Abid
 
Introduction to Qt
Introduction to QtIntroduction to Qt
Introduction to Qt
Puja Pramudya
 
Koin Quickstart
Koin QuickstartKoin Quickstart
Koin Quickstart
Matthew Clarke
 
MOOC_PRESENTATION_KOTLIN[1].pptx
MOOC_PRESENTATION_KOTLIN[1].pptxMOOC_PRESENTATION_KOTLIN[1].pptx
MOOC_PRESENTATION_KOTLIN[1].pptx
kamalkantmaurya1
 
moocs_ppt.pptx
moocs_ppt.pptxmoocs_ppt.pptx
moocs_ppt.pptx
kamalkantmaurya1
 
Multiplatform shared codebase with Kotlin/Native - UA Mobile 2019
Multiplatform shared codebase with Kotlin/Native - UA Mobile 2019Multiplatform shared codebase with Kotlin/Native - UA Mobile 2019
Multiplatform shared codebase with Kotlin/Native - UA Mobile 2019
UA Mobile
 
Multiplatform shared codebase with Kotlin/Native - UA Mobile 2019
Multiplatform shared codebase with Kotlin/Native - UA Mobile 2019Multiplatform shared codebase with Kotlin/Native - UA Mobile 2019
Multiplatform shared codebase with Kotlin/Native - UA Mobile 2019
Eugene Kurko
 
從零開始學 Android
從零開始學 Android從零開始學 Android
從零開始學 Android
秀吉(Hsiu-Chi) 蔡(Tsai)
 
Fall in love with Kotlin
Fall in love with KotlinFall in love with Kotlin
Fall in love with Kotlin
Hari Vignesh Jayapalan
 
Android Application Development (1).pptx
Android Application Development (1).pptxAndroid Application Development (1).pptx
Android Application Development (1).pptx
adityakale2110
 
Building Mobile Apps with Android
Building Mobile Apps with AndroidBuilding Mobile Apps with Android
Building Mobile Apps with Android
Kurt Renzo Acosta
 
Comment développer une application mobile en 8 semaines - Meetup PAUG 24-01-2023
Comment développer une application mobile en 8 semaines - Meetup PAUG 24-01-2023Comment développer une application mobile en 8 semaines - Meetup PAUG 24-01-2023
Comment développer une application mobile en 8 semaines - Meetup PAUG 24-01-2023
Nicolas HAAN
 
Being Expressive in Code
Being Expressive in CodeBeing Expressive in Code
Being Expressive in Code
Eamonn Boyle
 
Native cross-platform mobile apps with C# and Xamarin.Forms
Native cross-platform mobile apps with C# and Xamarin.FormsNative cross-platform mobile apps with C# and Xamarin.Forms
Native cross-platform mobile apps with C# and Xamarin.Forms
Peter Major
 
Встреча Google Post IO ( Владимир Иванов, Катерина Заворотченко и Сергей Комлач)
Встреча Google Post IO ( Владимир Иванов, Катерина Заворотченко и Сергей Комлач)Встреча Google Post IO ( Владимир Иванов, Катерина Заворотченко и Сергей Комлач)
Встреча Google Post IO ( Владимир Иванов, Катерина Заворотченко и Сергей Комлач)
Alina Vilk
 
Davide Cerbo - Kotlin loves React - Codemotion Milan 2018
Davide Cerbo - Kotlin loves React - Codemotion Milan 2018Davide Cerbo - Kotlin loves React - Codemotion Milan 2018
Davide Cerbo - Kotlin loves React - Codemotion Milan 2018
Codemotion
 
TypeScript Vs. KotlinJS
TypeScript Vs. KotlinJSTypeScript Vs. KotlinJS
TypeScript Vs. KotlinJS
Garth Gilmour
 
Reducing boilerplate with Kotlin, KTX and Kotlin Android Extensions
Reducing boilerplate with Kotlin, KTX and Kotlin Android ExtensionsReducing boilerplate with Kotlin, KTX and Kotlin Android Extensions
Reducing boilerplate with Kotlin, KTX and Kotlin Android Extensions
Patrick Steiger
 

Similar to Kotlin hands on - MorningTech ekito 2017 (20)

Geecon - Improve your Android-fu with Kotlin
Geecon - Improve your Android-fu with KotlinGeecon - Improve your Android-fu with Kotlin
Geecon - Improve your Android-fu with Kotlin
 
Kotlin what_you_need_to_know-converted event 4 with nigerians
Kotlin  what_you_need_to_know-converted event 4 with nigeriansKotlin  what_you_need_to_know-converted event 4 with nigerians
Kotlin what_you_need_to_know-converted event 4 with nigerians
 
Android 101 - Kotlin ( Future of Android Development)
Android 101 - Kotlin ( Future of Android Development)Android 101 - Kotlin ( Future of Android Development)
Android 101 - Kotlin ( Future of Android Development)
 
Introduction to Qt
Introduction to QtIntroduction to Qt
Introduction to Qt
 
Koin Quickstart
Koin QuickstartKoin Quickstart
Koin Quickstart
 
MOOC_PRESENTATION_KOTLIN[1].pptx
MOOC_PRESENTATION_KOTLIN[1].pptxMOOC_PRESENTATION_KOTLIN[1].pptx
MOOC_PRESENTATION_KOTLIN[1].pptx
 
moocs_ppt.pptx
moocs_ppt.pptxmoocs_ppt.pptx
moocs_ppt.pptx
 
Multiplatform shared codebase with Kotlin/Native - UA Mobile 2019
Multiplatform shared codebase with Kotlin/Native - UA Mobile 2019Multiplatform shared codebase with Kotlin/Native - UA Mobile 2019
Multiplatform shared codebase with Kotlin/Native - UA Mobile 2019
 
Multiplatform shared codebase with Kotlin/Native - UA Mobile 2019
Multiplatform shared codebase with Kotlin/Native - UA Mobile 2019Multiplatform shared codebase with Kotlin/Native - UA Mobile 2019
Multiplatform shared codebase with Kotlin/Native - UA Mobile 2019
 
從零開始學 Android
從零開始學 Android從零開始學 Android
從零開始學 Android
 
Fall in love with Kotlin
Fall in love with KotlinFall in love with Kotlin
Fall in love with Kotlin
 
Android Application Development (1).pptx
Android Application Development (1).pptxAndroid Application Development (1).pptx
Android Application Development (1).pptx
 
Building Mobile Apps with Android
Building Mobile Apps with AndroidBuilding Mobile Apps with Android
Building Mobile Apps with Android
 
Comment développer une application mobile en 8 semaines - Meetup PAUG 24-01-2023
Comment développer une application mobile en 8 semaines - Meetup PAUG 24-01-2023Comment développer une application mobile en 8 semaines - Meetup PAUG 24-01-2023
Comment développer une application mobile en 8 semaines - Meetup PAUG 24-01-2023
 
Being Expressive in Code
Being Expressive in CodeBeing Expressive in Code
Being Expressive in Code
 
Native cross-platform mobile apps with C# and Xamarin.Forms
Native cross-platform mobile apps with C# and Xamarin.FormsNative cross-platform mobile apps with C# and Xamarin.Forms
Native cross-platform mobile apps with C# and Xamarin.Forms
 
Встреча Google Post IO ( Владимир Иванов, Катерина Заворотченко и Сергей Комлач)
Встреча Google Post IO ( Владимир Иванов, Катерина Заворотченко и Сергей Комлач)Встреча Google Post IO ( Владимир Иванов, Катерина Заворотченко и Сергей Комлач)
Встреча Google Post IO ( Владимир Иванов, Катерина Заворотченко и Сергей Комлач)
 
Davide Cerbo - Kotlin loves React - Codemotion Milan 2018
Davide Cerbo - Kotlin loves React - Codemotion Milan 2018Davide Cerbo - Kotlin loves React - Codemotion Milan 2018
Davide Cerbo - Kotlin loves React - Codemotion Milan 2018
 
TypeScript Vs. KotlinJS
TypeScript Vs. KotlinJSTypeScript Vs. KotlinJS
TypeScript Vs. KotlinJS
 
Reducing boilerplate with Kotlin, KTX and Kotlin Android Extensions
Reducing boilerplate with Kotlin, KTX and Kotlin Android ExtensionsReducing boilerplate with Kotlin, KTX and Kotlin Android Extensions
Reducing boilerplate with Kotlin, KTX and Kotlin Android Extensions
 

Recently uploaded

Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)
Jakub Marek
 
Northern Engraving | Nameplate Manufacturing Process - 2024
Northern Engraving | Nameplate Manufacturing Process - 2024Northern Engraving | Nameplate Manufacturing Process - 2024
Northern Engraving | Nameplate Manufacturing Process - 2024
Northern Engraving
 
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development ProvidersYour One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
akankshawande
 
The Microsoft 365 Migration Tutorial For Beginner.pptx
The Microsoft 365 Migration Tutorial For Beginner.pptxThe Microsoft 365 Migration Tutorial For Beginner.pptx
The Microsoft 365 Migration Tutorial For Beginner.pptx
operationspcvita
 
Taking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdfTaking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdf
ssuserfac0301
 
Digital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
Digital Banking in the Cloud: How Citizens Bank Unlocked Their MainframeDigital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
Digital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
Precisely
 
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdfMonitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Tosin Akinosho
 
Nordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptxNordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptx
MichaelKnudsen27
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Safe Software
 
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdfHow to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
Chart Kalyan
 
AppSec PNW: Android and iOS Application Security with MobSF
AppSec PNW: Android and iOS Application Security with MobSFAppSec PNW: Android and iOS Application Security with MobSF
AppSec PNW: Android and iOS Application Security with MobSF
Ajin Abraham
 
Astute Business Solutions | Oracle Cloud Partner |
Astute Business Solutions | Oracle Cloud Partner |Astute Business Solutions | Oracle Cloud Partner |
Astute Business Solutions | Oracle Cloud Partner |
AstuteBusiness
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
Zilliz
 
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
Edge AI and Vision Alliance
 
June Patch Tuesday
June Patch TuesdayJune Patch Tuesday
June Patch Tuesday
Ivanti
 
5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides
DanBrown980551
 
Dandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity serverDandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity server
Antonios Katsarakis
 
Fueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte WebinarFueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte Webinar
Zilliz
 
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
saastr
 
Principle of conventional tomography-Bibash Shahi ppt..pptx
Principle of conventional tomography-Bibash Shahi ppt..pptxPrinciple of conventional tomography-Bibash Shahi ppt..pptx
Principle of conventional tomography-Bibash Shahi ppt..pptx
BibashShahi
 

Recently uploaded (20)

Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)
 
Northern Engraving | Nameplate Manufacturing Process - 2024
Northern Engraving | Nameplate Manufacturing Process - 2024Northern Engraving | Nameplate Manufacturing Process - 2024
Northern Engraving | Nameplate Manufacturing Process - 2024
 
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development ProvidersYour One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
 
The Microsoft 365 Migration Tutorial For Beginner.pptx
The Microsoft 365 Migration Tutorial For Beginner.pptxThe Microsoft 365 Migration Tutorial For Beginner.pptx
The Microsoft 365 Migration Tutorial For Beginner.pptx
 
Taking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdfTaking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdf
 
Digital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
Digital Banking in the Cloud: How Citizens Bank Unlocked Their MainframeDigital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
Digital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
 
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdfMonitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdf
 
Nordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptxNordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptx
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
 
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdfHow to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
 
AppSec PNW: Android and iOS Application Security with MobSF
AppSec PNW: Android and iOS Application Security with MobSFAppSec PNW: Android and iOS Application Security with MobSF
AppSec PNW: Android and iOS Application Security with MobSF
 
Astute Business Solutions | Oracle Cloud Partner |
Astute Business Solutions | Oracle Cloud Partner |Astute Business Solutions | Oracle Cloud Partner |
Astute Business Solutions | Oracle Cloud Partner |
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
 
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
 
June Patch Tuesday
June Patch TuesdayJune Patch Tuesday
June Patch Tuesday
 
5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides
 
Dandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity serverDandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity server
 
Fueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte WebinarFueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte Webinar
 
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
 
Principle of conventional tomography-Bibash Shahi ppt..pptx
Principle of conventional tomography-Bibash Shahi ppt..pptxPrinciple of conventional tomography-Bibash Shahi ppt..pptx
Principle of conventional tomography-Bibash Shahi ppt..pptx
 

Kotlin hands on - MorningTech ekito 2017

  • 2. Schedule 9:00 - Introduction 9:05 - Intro to Kotlin part 1 9:25 - Project presentation & setup 9:35 - Hands-on part 1 (55 minutes) 10:30 - Coffee break 10:45 - Intro to Kotlin part 2 11:00 - Hands-on part 2 (55 minutes) 11:55 - Final Part #androiddev #kotlin #morningtech @ekito
  • 3. Practical notes https://github.com/Ekito/2017-handson-kotlinAndroid Grab your stuff ! #androiddev #kotlin #morningtech @ekito
  • 4. @Baresse Work @ ekito Developer & Geek Fullstack & MobileLaurent BARESSE @arnogiu Work @ ekito Core & Gear Maker Mobile & CloudArnaud GIULIANI #androiddev #kotlin #morningtech @ekito
  • 5. https://www.ekito.fr/careers Join the team ! #androiddev #kotlin #morningtech @ekito
  • 6. Intro to part 1 #androiddev #kotlin #morningtech @ekito
  • 8. #androiddev #kotlin #morningtech @ekito Kotlin 1.1.1 @ 15.03.2017
  • 9. Yet another JVM Language ? #androiddev #kotlin #morningtech @ekito
  • 10. The new « Swift » for Android ? #androiddev #kotlin #morningtech @ekito
  • 12. What’s Kotlin ? - Fully open source (built by Jetbrains) - Run on Java 6+ - Static typing & type inference - Modern language features - 1st grade tooling #androiddev #kotlin #morningtech @ekito
  • 13. How K can help you ? - Conciseness - Null Safety & Immutability protection - Static Typing & Smart Casts - Open programming styles (lambdas, high order functions …) - Java Interop #androiddev #kotlin #morningtech @ekito
  • 14. More About Kotlin … - String templates - Properties - Lambdas - Data class - Smart cast - Null safety - Lazy property - Default values for function parameters - Extension Functions - No more ; - Single-expression functions - When expression - let, apply, use, with - Collections - Android Extensions Plugin #androiddev #kotlin #morningtech @ekito
  • 15. Compare with Same conciseness and expressive code, but Kotlin static typing and null-safety make a big difference. "Some people say Kotlin has 80% the power of Scala, with 20% of the features" * 
 "Kotlin is a software engineering language in contrast to Scala which is a computing science language." * Swift and Kotlin are VERY similar. Swift is LLVM based and has C interop while Kotlin is JVM based and has Java interop. * Quotes from Kotlin:TheYing andYang of Programming Languages #androiddev #kotlin #morningtech @ekito @ sdeleuze
  • 16. is Kotlin Android friendly ? https://github.com/SidneyXu/AndroidDemoIn4Languages Method counts by Language #androiddev #kotlin #morningtech @ekito
  • 17. KOTLIN is not just about writing your app with lesser lines. It’s all about writing SAFER & BETTER APPS ! #androiddev #kotlin #morningtech @ekito
  • 18. 18 Let’s Go ! #androiddev #kotlin #morningtech @ekito
  • 19. Typing & Inference val a: Int = 1
 val b = 1 // `Int` type is inferred var x = 5 // `Int` type is inferred
 x += 1 Inferred values Mutable values val : constant value - IMMUTABLE var : variable value - MUTABLE USE VAL AS MUCH AS POSSIBLE ! #androiddev #kotlin #morningtech @ekito
  • 20. Safety with Optionals var stringA: String = "foo"
 stringA = null //Compilation error - stringA is a String (non optional)
 
 var stringB: String? = "bar" // stringB is an Optional String
 stringB = null //ok Optional value #androiddev #kotlin #morningtech @ekito
  • 21. // set length default value manually
 val length = if (stringB != null) stringB.length else -1
 //or with the Elvis operator
 val length = stringB?.length ?: -1 DefaultValue & Elvis Operator val length = stringB.length // Compilation error - stringB can be null !
 // use ? the safe call operator
 val length = stringB?.length //Value or null - length is type Int? val length = stringB!!.length //Value or explicit throw NPE - length is type Int Safe call with ?. or Explicit call with !!. #androiddev #kotlin #morningtech @ekito
  • 22. Example Working with optional values #androiddev #kotlin #morningtech @ekito
  • 23. Example Null check safety & Smart cast Securing with default values #androiddev #kotlin #morningtech @ekito
  • 24. Class class User (
 val userName: String,
 val firstName: String,
 val lastName: String,
 var location: Point? = null
 ) POJO + - Getter - Setter - Constructors public / closed by default #androiddev #kotlin #morningtech @ekito
  • 25. Data Class data class User (
 val userName: String,
 val firstName: String,
 val lastName: String,
 var location: Point? = null
 ) POJO + - Getter - Setter - Constructors - toString - hashcode - equals - copy #androiddev #kotlin #morningtech @ekito
  • 27. Properties // readonly property
 val isEmpty: Boolean
 get() = this.size == 0 Properties can be declared in constructor or in class You can also handle getter & setter // customer getter & setter
 var stringRepresentation: String set(value) {
 … } class ApiKey(var weatherKey: String, var geocodeKey: String){
 var debug : Boolean = false
 } * Late initialization, Lazy, Delegates … #androiddev #kotlin #morningtech @ekito
  • 28. Example data class User(val name: String = "", val age: Int = 0) val jack = User(name = "Jack", age = 1) //no new keyword
 val anotherJack = jack.copy(age = 2) Data Class usage A simple GSon Class #androiddev #kotlin #morningtech @ekito
  • 29. Object Class // singleton
 object Resource {
 val name = "Name"
 } class StringCalculator{ // class helper
 companion object{
 val operators = arrayOf("+","-","x","/")
 }
 } Singleton Class Companion Object #androiddev #kotlin #morningtech @ekito
  • 30. When in <range> -> is <type> -> expression -> when (s) {
 1 -> print("x == 1")
 2 -> print("x == 2")
 else -> { // Note the block
 print("x is neither 1 nor 2")
 }
 } Flow Control (replace your old if blocks) when (x) {
 in 1..10 -> print("x is in the range")
 in validNumbers -> print("x is valid")
 !in 10..20 -> print("x is outside the range")
 else -> print("none of the above")
 } Pattern Matching * can match with operators : in, as, is, range … #androiddev #kotlin #morningtech @ekito
  • 31. Example Android Page Adapter Pattern Matching #androiddev #kotlin #morningtech @ekito
  • 32. Collections // immutable map
 val map = mapOf("a" to 1, "b" to 2, "c" to 3)
 for ((k, v) in map) {
 println("$k -> $v")
 } 
 map2["a"] = "my value" // direct map access with array style // range
 for (i in 1..100) { //... } // immutable list
 val list = listOf("a", "b", "c","aa")
 list.filter { it.startsWith("a") } * collections operators : map, filter, take, flatMap, forEach, firstOrNull, last … #androiddev #kotlin #morningtech @ekito
  • 33. Example Kotlin Collection Java 7 Collection #androiddev #kotlin #morningtech @ekito
  • 34. InterOp Java/Kotlin object UserSingleton{
 fun stringify(user : User) : String{
 // …
 }
 } fun WhatIsyourAge(user : User){
 println("Your age is ${user.age}")
 } data class User (val name: String, val age : Int){
 companion object{
 fun sayHello(user : User){ //…
 }
 }
 } User u = new User("toto",42);
 User.Companion.sayHello(u); UserUtilsKt.WhatIsyourAge(u); UserSingleton.INSTANCE.stringify(u) #androiddev #kotlin #morningtech @ekito
  • 35. Project presentation & setup #androiddev #kotlin #morningtech @ekito
  • 36. My Weather app #androiddev #kotlin #morningtech @ekito
  • 37. Get the project #androiddev #kotlin #morningtech @ekito https://github.com/Ekito/2017-handson-kotlinAndroid
  • 38. Create your branch #androiddev #kotlin #morningtech @ekito https://github.com/Ekito/2017-handson-kotlinAndroid/blob/master/README.pdf
  • 40. Hands-on part 1 #androiddev #kotlin #morningtech @ekito
  • 41. 9:00 - Introduction 9:05 - Intro to Kotlin part 1 9:25 - Project presentation & setup 9:35 - Hands-on part 1 (55 minutes) 10:30 - Coffee break 10:45 - Intro to Kotlin part 2 11:00 - Hands-on part 2 (55 minutes) 11:55 - Final Part Hands-on ! #androiddev #kotlin #morningtech @ekito
  • 42. 9:00 - Introduction 9:05 - Intro to Kotlin part 1 9:25 - Project presentation & setup 9:35 - Hands-on part 1 (55 minutes) 10:30 - Coffee break 10:45 - Intro to Kotlin part 2 11:00 - Hands-on part 2 (55 minutes) 11:55 - Final Part #androiddev #kotlin #morningtech @ekito Coffee Break !
  • 43. Intro to part 2 #androiddev #kotlin #morningtech @ekito
  • 44. Sweet stuffs for #androiddev #kotlin #morningtech @ekito
  • 45. Kotlin’s Android Extensions apply plugin: 'com.android.application' apply plugin:‘kotlin-android’ apply plugin:‘kotlin-android-extensions’ // if use extensions In your build.gradle #androiddev #kotlin #morningtech @ekito
  • 46. Kotlin Java #androiddev #kotlin #morningtech @ekito * In Fragment : onViewCreated()
  • 47. Lambdas val fab = findViewById(R.id.fab) as FloatingActionButton
 fab.setOnClickListener { view -> popLocationDialog(view) } A lambda expression or an anonymous function is a “function literal”, i.e. a function that is not declared, but passed immediately as an expression - A lambda expression is always surrounded by curly braces - Its parameters (if any) are declared before -> (parameter types may be omitted), - The body goes after -> (when present). myNumber.split("n").flatMap { it.split(separator) }
 .map(Integer::parseInt)
 .map(::checkPositiveNumber)
 .filter { it <= 1000 }
 .sum() * Method references are not surrounded by curly braces ! #androiddev #kotlin #morningtech @ekito
  • 48. Functions fun reformat(str: String,
 normalizeCase: Boolean = true,
 upperCaseFirstLetter: Boolean = true,
 wordSeparator: Char = ' '): String {
 
 } Named Parameters & default values reformat(str, true, true, '_') // old way to call
 reformat(str, wordSeparator = '_') // using default values & named params #androiddev #kotlin #morningtech @ekito
  • 51. Lamba expressions Functional Programming Reactive Streams http://reactivex.io/documentation/operators.html http://www.reactive-streams.org/ https://spring.io/blog/2016/06/07/notes-on-reactive- programming-part-i-the-reactive-landscape #androiddev #kotlin #morningtech @ekito
  • 52. Example - Rx/Retrofit Kotlin Java #androiddev #kotlin #morningtech @ekito
  • 53. Hands-on part 2 #androiddev #kotlin #morningtech @ekito
  • 54. 9:00 - Introduction 9:05 - Intro to Kotlin part 1 9:25 - Project presentation & setup 9:35 - Hands-on part 1 (55 minutes) 10:30 - Coffee break 10:45 - Intro to Kotlin part 2 11:00 - Hands-on part 2 (55 minutes) 11:55 - Final Part #androiddev #kotlin #morningtech @ekito Hands-on !
  • 55. Final Part #androiddev #kotlin #morningtech @ekito
  • 56. #androiddev #kotlin #morningtech @ekito Time is over !
  • 57. Smarter development for the JVM Kotlin #androiddev #kotlin #morningtech @ekito
  • 58. Thank you for coming #androiddev #kotlin #morningtech @ekito