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
120
Other Decks in Programming
See All in Programming
Snowflakeで眠ったデータを起こそう!
estie
0
120
Scalable Customer Journey Orchestration (CJO)
lewuathe
0
340
TYPO3 v13 – The road to LTS: What's new and new APIs
luisasofie_xoxo
0
210
Zero Waste, Radical Magic, and Italian Graft – Quarkus Efficiency Secrets
hollycummins
0
230
Elm Form Validation
bkuhlmann
0
510
Rubyでたのしむクリエイティブコーディング/Enjoy Creative coding with Ruby
chobishiba
1
180
Prepare for Jakarta EE 11 - Performance and Developer Productivity
ivargrimstad
0
810
Milestoner
bkuhlmann
1
410
Code Reviews
bkuhlmann
4
890
PostmanでAPIの動作確認が楽になった話
h455h1
0
170
Hanami and htmx
bkuhlmann
0
210
はてなにおける CSS Modules、及び CSS Modules に足りないもの / CSS Modules in Hatena, and CSS Modules missing parts
mizdra
7
940
Featured
See All Featured
Design by the Numbers
sachag
274
18k
A Tale of Four Properties
chriscoyier
151
22k
The Art of Programming - Codeland 2020
erikaheidi
42
12k
GraphQLの誤解/rethinking-graphql
sonatard
50
9.2k
The Cost Of JavaScript in 2023
addyosmani
16
3.9k
Raft: Consensus for Rubyists
vanstee
132
6.3k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
241
1.2M
For a Future-Friendly Web
brad_frost
172
9k
We Have a Design System, Now What?
morganepeng
43
6.8k
Building Adaptive Systems
keathley
31
1.9k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
25
2.3k
No one is an island. Learnings from fostering a developers community.
thoeni
16
2.1k
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