Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Kotlin sintax overview
Search
Felipe Oliveira
April 30, 2016
Programming
0
78
Kotlin sintax overview
This talk is result of my presentation on AndroidStudyJams Maceió
Felipe Oliveira
April 30, 2016
Tweet
Share
More Decks by Felipe Oliveira
See All by Felipe Oliveira
Validação com Android Saripaar 2
oliveiradev
0
83
Other Decks in Programming
See All in Programming
Inside of Swift Export
giginet
PRO
1
230
Amazon ECS Managed Instances が リリースされた!キャッチアップしよう!! / Let's catch up Amazon ECS Managed Instances
cocoeyes02
0
110
AI Agent 時代的開發者生存指南
eddie
4
2.2k
Vue 3.6 時代のリアクティビティ最前線 〜Vapor/alien-signals の実践とパフォーマンス最適化〜
hiranuma
2
280
Leading Effective Engineering Teams in the AI Era
addyosmani
7
670
Towards Transactional Buffering of CDC Events @ Flink Forward 2025 Barcelona Spain
hpgrahsl
0
120
外接に惑わされない自システムの処理時間SLIをOpenTelemetryで実現した話
kotaro7750
0
130
Swift Concurrency 年表クイズ
omochi
3
180
バッチ処理を「状態の記録」から「事実の記録」へ
panda728
PRO
0
210
Server Side Kotlin Meetup vol.16: 内部動作を理解して ハイパフォーマンスなサーバサイド Kotlin アプリケーションを書こう
ternbusty
3
260
CSC305 Lecture 10
javiergs
PRO
0
320
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
410
Featured
See All Featured
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
54k
Making Projects Easy
brettharned
120
6.4k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
658
61k
Art, The Web, and Tiny UX
lynnandtonic
303
21k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
1.7k
Music & Morning Musume
bryan
46
6.9k
Measuring & Analyzing Core Web Vitals
bluesmoon
9
650
Building Better People: How to give real-time feedback that sticks.
wjessup
370
20k
How to Think Like a Performance Engineer
csswizardry
27
2.2k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
190
55k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4k
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.5k
Transcript
Kotlin for Android Felipe Oliveira oliveiradev
Felipe Oliveira
Linguagem foi criada pela JetBrains, Kotlin roda na JVM e
é 100% interoperável com Java.
None
Sintaxe overview: atributos
Sintaxe overview: métodos
Sintaxe overview: classes class Person {} open class Person {}
data class Person(val name: String, val age: Int)
Sintaxe overview: Null safety val person: Person? = Person("Felipe",24) fun
main(args: Array<String>) { print(person?.name) }
Sintaxe overview: Default arguments fun query(table: String, columns: Array<String>, orderBy:
String? = null, limit: Int? = null){ ... } query("PEOPLE", arrayOf("ID","NAME")) query("PEOPLE", arrayOf("ID","NAME") , limit = 10)
Sintaxe overview: Extension functions fun ImageView.loadForUrl(url: String){ Picasso.with(context).load(url).into(this) } //single
expression sintax fun String.hello() = "Hello $this"
Sintaxe overview: When expression when(value){ is String -> print("eh String")
else -> print("n eh String") }
Sintaxe overview: Smart cast if (value is String){ print(value.length) }
Instalando plugin no Android Studio apply plugin: 'kotlin-android' android {
... sourceSets { main.java.srcDirs += 'src/main/kotlin' } ... } dependencies { ... compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" ... } buildscript { ext.kotlin_version = '1.0.1-2' repositories { mavenCentral() } dependencies { classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } }
Referências Jake Wharton https://plus.google.com/+JakeWharton/posts/WSCoqkJ5MBj Kotlin lang docs reference https://kotlinlang.org/docs/reference Antonio
Leiva Blog http://antonioleiva.com/kotlin/ Comece agora a brincar com kotlin http://try.kotlinlang.org/