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
Construindo o primeiro app usando Kotlin
Search
Filipe Guedes
September 06, 2016
Programming
0
110
Construindo o primeiro app usando Kotlin
Filipe Guedes
September 06, 2016
Tweet
Share
More Decks by Filipe Guedes
See All by Filipe Guedes
Kotlin & Android, Java é opcional
fgsguedes
2
130
Other Decks in Programming
See All in Programming
第9回 情シス転職ミートアップ 株式会社IVRy(アイブリー)の紹介
ivry_presentationmaterials
1
260
AWS CDKの推しポイント 〜CloudFormationと比較してみた〜
akihisaikeda
3
320
NPOでのDevinの活用
codeforeveryone
0
730
技術同人誌をMCP Serverにしてみた
74th
1
590
なぜ「共通化」を考え、失敗を繰り返すのか
rinchoku
1
630
都市をデータで見るってこういうこと PLATEAU属性情報入門
nokonoko1203
1
590
XP, Testing and ninja testing
m_seki
3
220
地方に住むエンジニアの残酷な現実とキャリア論
ichimichi
5
1.5k
20250704_教育事業におけるアジャイルなデータ基盤構築
hanon52_
5
500
Porting a visionOS App to Android XR
akkeylab
0
220
RailsGirls IZUMO スポンサーLT
16bitidol
0
150
PHP 8.4の新機能「プロパティフック」から学ぶオブジェクト指向設計とリスコフの置換原則
kentaroutakeda
2
730
Featured
See All Featured
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
130
19k
Designing for Performance
lara
609
69k
The Pragmatic Product Professional
lauravandoore
35
6.7k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
29
1.8k
A Tale of Four Properties
chriscoyier
160
23k
Learning to Love Humans: Emotional Interface Design
aarron
273
40k
The Cult of Friendly URLs
andyhume
79
6.5k
Speed Design
sergeychernyshev
32
1k
Unsuck your backbone
ammeep
671
58k
How to Ace a Technical Interview
jacobian
277
23k
4 Signs Your Business is Dying
shpigford
184
22k
Statistics for Hackers
jakevdp
799
220k
Transcript
Construindo o primeiro app usando Kotlin Filipe Guedes Philipe Steiff
@fgsguedes @philipesteiff
Por que Kotlin? • Concisa, simples e fácil de ler/escrever
• 100% "two-way" interoperável com Java • Também é funcional • Null-safety • Extension functions • It's fun
class Foo { fun sum(a: Int, b: Int): Int
{ return a + b } fun printSum(a: Int, b: Int): Unit { print(a + b) } }
class Foo { fun sum(a: Int, b: Int) =
a + b fun printSum(a: Int, b: Int) { print(a + b) } }
val a: Int = 1 val b = 1
var c = "Any variable" val d = Foo()
Null Safety var a: String = "abc"
Null Safety var a: String = "abc" a = null
Null Safety var a: String = "abc" a = null
// compilation error
Null Safety var a: String = "abc" a = null
// compilation error println(a.length)
Null Safety var a: String? = "abc" a = null
println(a.length)
Null Safety var a: String? = "abc" a = null
println(a.length) // compilation error
Null Safety var a: String? = "abc" a = null
println(a?.length)
Null Safety var a: String? = "abc" a = null
println(a?.length) // will print 'null'
Null Safety var a: String? = "abc" a = null
println(a?.length ?: "Was null") // will print 'Was null'
Null Safety var a: String? = "abc" a = null
println(a!!.length) // XGH
Extensions fun Parcel.readBoolean() = readByte() > 0 fun Parcel.writeBoolean(boolean:
Boolean) { when { boolean -> writeByte(1) else -> writeByte(0) } } override fun writeToParcel(parcel: Parcel, p1: Int) { parcel.writeBoolean(myBooleanField) } myBooleanField = parcel.readBoolean()
Quem está usando!?
Some live coding!! Wish us luck