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 por onde começar?
Search
José Caique Oliveira
July 08, 2017
Programming
110
1
Share
Kotlin por onde começar?
Como começar no Kotlin para Android
José Caique Oliveira
July 08, 2017
More Decks by José Caique Oliveira
See All by José Caique Oliveira
Kotlin Flow
jcaiqueoliveira
0
140
Coroutines And Flow
jcaiqueoliveira
2
130
Testing your app
jcaiqueoliveira
0
320
Modularizando seu app
jcaiqueoliveira
0
83
Nova Api de Localização Android
jcaiqueoliveira
0
100
Arquitetura para android
jcaiqueoliveira
6
330
Introdução ao Android
jcaiqueoliveira
1
100
Arquitetura para projetos Android
jcaiqueoliveira
1
250
Kotlin 1.1
jcaiqueoliveira
0
150
Other Decks in Programming
See All in Programming
Migrations : C'est une question d'hygiène !
vinceamstoutz
0
2.2k
GitHub Copilot CLIのいいところ
htkym
2
1.1k
oxlintはeslint/typescript-eslintを置き換えられるのか
shomafujita
2
270
AI時代の仕事技芸論 — ソフトウェア開発で「遊ぶように働く」職人的熟達のすすめ
kuranuki
1
400
Modding RubyKaigi for Myself
yui_knk
0
540
技術記事、AIに書かせるか、自分で書くか? 〜それでも私が自分の手で書く理由〜 / #QiitaConference
jnchito
2
1.1k
AIエージェントの隔離技術の徹底比較
kawayu
0
440
AIエージェントと協働するCLI開発 — BunとOpenClawで学んだこと
yoshikouki
1
220
SPMマルチモジュールで テストカバレッジを取得する技法
yosshi4486
0
130
ビジネスモデルから紐解く、AI+型駆動開発
hirokiomote
2
3.3k
ふつうのFeature Flag実践入門
irof
6
3.2k
CLIであることを活かしたGitHub Copilot CLI活用術 / GitHub Copilot CLI Pro Tips & Tricks
nao_mk2
1
1.1k
Featured
See All Featured
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.5k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
22k
Why Mistakes Are the Best Teachers: Turning Failure into a Pathway for Growth
auna
0
150
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
8.1k
The Straight Up "How To Draw Better" Workshop
denniskardys
239
140k
Thoughts on Productivity
jonyablonski
76
5.2k
The Hidden Cost of Media on the Web [PixelPalooza 2025]
tammyeverts
2
310
XXLCSS - How to scale CSS and keep your sanity
sugarenia
250
1.3M
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
210
Kristin Tynski - Automating Marketing Tasks With AI
techseoconnect
PRO
0
260
Taking LLMs out of the black box: A practical guide to human-in-the-loop distillation
inesmontani
PRO
3
2.2k
Evolving SEO for Evolving Search Engines
ryanjones
0
210
Transcript
Kotlin por onde começar Caique Oliveira
val e var val nome : String = “Caique” nome
= “José” (erro) var nome1 : String = “Caique” nome1 = “Oliveira” https://goo.gl/Uef9D2
Criando um objeto class Client { } val client =
Client() https://goo.gl/1bqnX S
Kotlin é null safety cpf?.removeNonNumeric() cpf!!.removeNonNumeric() https://goo.gl/Dz47kY
Construtor no Kotlin Class Client constructor(var name: String, var city
: String) { fun printName(){ print(name) } } https://goo.gl/KFcmnV
Data class - Classes para a representação de dados data
class User(val name: String,val age: Int) https://goo.gl/DRxvPy
Criando funções com o Kotlin fun double(value: Int) : Int
{ return value * 2 } fun sum(a: Int,b : Int = 0){ return a + b } sum(1) sum(2,3) https://goo.gl/TZdf2Y
Lambdas - remove boilerplate - simplifica código button.setOnClickListener{ Toast.makeText(activity,”Olá”,Toast.LENGTH_LONG).show() }
https://goo.gl/PDbLtq
for for ( i in 0 .. 2 ) {
} for(client : Client in clients) { } https://goo.gl/fYZNNU
with with(recyclerView){ setHasFixedSize(true) layoutManager = LinearLayoutManager(activity) } https://goo.gl/PLV6fY
when when(view.id){ R.id.button1 -> { } R.id.button2 -> { }
} https://goo.gl/r5hHqX
apply - possui como referência o this dialog?.apply{ this.dismiss() }
https://goo.gl/RJzPp9
let - possui como referência o it dialog?.apply{ it.dismiss() }
https://goo.gl/VS1hWE
run - chama um bloco de código e retorna um
resultado dialog?.run{ isVisible } https://goo.gl/ChNq4d
Extensions - Possível adicionar novos comportamentos a uma classe fun
View.visible() { visibility = View.VISIBLE } antes imageView.visibility = View.VISIBLE depois imageView.visible() https://goo.gl/N4isRx
Kotlin- Extensions: Adeus findViewById adicionar ao cabeçalho do gradle: apply
plugin: ‘kotlin-android-extensions’ antes val button = findViewById(R.id.button) as Button button.setOnClickListener{ } depois //val button = findViewById(R.id.button) as Button button.setOnClickListener{ } https://goo.gl/kx1GXJ
Graduado em Ciência da computação - UFS Android Developer -
Stone Pagamentos
[email protected]
@jc_hobbit Caique Oliveira