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
77
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
80
Other Decks in Programming
See All in Programming
datadog dash 2025 LLM observability for reliability and stability
ivry_presentationmaterials
0
180
エラーって何種類あるの?
kajitack
5
320
VS Code Update for GitHub Copilot
74th
1
470
なんとなくわかった気になるブロックテーマ入門/contents.nagoya 2025 6.28
chiilog
1
240
Webの外へ飛び出せ NativePHPが切り拓くPHPの未来
takuyakatsusa
2
440
Bytecode Manipulation 으로 생산성 높이기
bigstark
2
380
ASP.NETアプリケーションのモダナイズ インフラ編
tomokusaba
1
420
AIプログラマーDevinは PHPerの夢を見るか?
shinyasaita
1
170
たった 1 枚の PHP ファイルで実装する MCP サーバ / MCP Server with Vanilla PHP
okashoi
1
210
0626 Findy Product Manager LT Night_高田スライド_speaker deck用
mana_takada
0
130
What Spring Developers Should Know About Jakarta EE
ivargrimstad
0
310
PicoRuby on Rails
makicamel
2
110
Featured
See All Featured
A Modern Web Designer's Workflow
chriscoyier
694
190k
[RailsConf 2023] Rails as a piece of cake
palkan
55
5.6k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
229
22k
Rebuilding a faster, lazier Slack
samanthasiow
82
9.1k
Typedesign – Prime Four
hannesfritz
42
2.7k
Making the Leap to Tech Lead
cromwellryan
134
9.4k
Become a Pro
speakerdeck
PRO
28
5.4k
Imperfection Machines: The Place of Print at Facebook
scottboms
267
13k
Docker and Python
trallard
44
3.4k
Unsuck your backbone
ammeep
671
58k
GraphQLの誤解/rethinking-graphql
sonatard
71
11k
The Art of Programming - Codeland 2020
erikaheidi
54
13k
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/