Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Kotlin por onde começar?
Search
José Caique Oliveira
July 08, 2017
Programming
130
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Kotlin por onde começar?
Como começar no Kotlin para Android
José Caique Oliveira
July 08, 2017
Transcript
17 slides
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
More Decks by José Caique Oliveira
See All by José Caique Oliveira
Kotlin Flow
jcaiqueoliveira
0
160
Coroutines And Flow
jcaiqueoliveira
2
160
Testing your app
jcaiqueoliveira
0
350
Modularizando seu app
jcaiqueoliveira
0
95
Nova Api de Localização Android
jcaiqueoliveira
0
120
Arquitetura para android
jcaiqueoliveira
6
340
Introdução ao Android
jcaiqueoliveira
1
120
Arquitetura para projetos Android
jcaiqueoliveira
1
270
Kotlin 1.1
jcaiqueoliveira
0
170
Other Decks in Programming
See All in Programming
DroidKnights 2026 Android A2UI Jetpack Compose 기반의 안전한 AI UI 렌더링 - 박제창
itsmedreamwalker
1
260
Scalaの型でマルチテナントの認可を守る
nextbeatdev
0
180
AI時代のFlutter品質設計 — アプリ品質を守るQuality Layers
omatty198
0
390
[DroidKnights 2026] Workflow AX: From Auto-Documented Policies to E2E Testing
raeminkang
0
610
クラウドエージェントは、 何がそんなに便利なのか / what makes cloud agents so useful
rkaga
5
980
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
130
Crash Auto Pipelines
veronikapj
1
450
ローカルLLMの基本と近況 2611 / Local LLM basics and recent situation 2611
kishida
3
660
SONY CISC-NEWS NWS-1750 + NWB-225 ハードウェアメンテとフレームバッファカラー対応 / KOF2026
tsutsui
0
130
特急いなほ as a Workflow / 20261107jaws-festa-2026-akita-lt
kasacchiful
PRO
0
110
protojson における文字化けの扱い
kazuki1023
0
460
マルチプロダクトSaaSの アプリ一覧を速くする——複数プロダクトにまたがる「権限行脚」を減らすまで #techramen26conf
mktakuya
1
180
Featured
See All Featured
More Than Pixels: Becoming A User Experience Designer
marktimemedia
3
640
Intergalactic Javascript Robots from Outer Space
tanoku
273
28k
What does AI have to do with Human Rights?
axbom
PRO
1
2.5k
AI: The stuff that nobody shows you
jnunemaker
PRO
12
1.3k
Data-driven link building: lessons from a $708K investment (BrightonSEO talk)
szymonslowik
1
1.5k
A better future with KSS
kneath
240
18k
Bootstrapping a Software Product
garrettdimon
PRO
306
120k
Rails Girls Zürich Keynote
gr2m
96
14k
Rebuilding a faster, lazier Slack
samanthasiow
85
9.8k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
2.2k
Web Performance Is a Journey [PerfNow 2026]
tammyeverts
2
150
The Mindset for Success: Future Career Progression
greggifford
PRO
0
570