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
Using Kotlin in Android
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Ivan
May 03, 2019
Programming
120
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Using Kotlin in Android
Kotlin examples for study group in Taiwan Kotlin User Group
Ivan
May 03, 2019
More Decks by Ivan
See All by Ivan
KtRssReader 的奇幻旅程
ivanw
0
150
Kotlin Flow Application and Testing on Android
ivanw
0
350
Kotlin Flow Application and Testing on Android
ivanw
1
480
A Step-by-Step Guide to Kotlin Flow 手把手帶你認識 Kotlin Flow
ivanw
0
280
Coroutines Made Easy
ivanw
1
210
All About KotlinConf 2019
ivanw
0
140
Writing Tests in Kotlin
ivanw
0
370
Other Decks in Programming
See All in Programming
ジョジョの世界をXRで再現する
mofurune
0
180
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
360
🇪🇸 React Alicante 2026 (Workshop)
ythecombinator
PRO
0
100
When benchmarks go bad - what I learned from measuring performance wrong
hollycummins
0
240
AIで開発が速くなった先で、開発チームは何を目指すか
shihochan
1
1.7k
AI-Powered Domain-Driven Design
ziobrando
0
250
R8 の設定見直しでアプリサイズ削減
andpad
0
220
AmebaブログはKMPから卒業します
kmars0605
0
220
コードレビューのボトルネックを"する側"と"される側"の両面から解消する
yub0n
2
1.7k
ハーネス設計入門 〜 基礎知識の整理から実務へのステップアップ 〜
kinopeee
28
34k
AI時代のコードレビューは人に向けるな、仕組みに向けろ
texmeijin
5
3.7k
PyConTW 2026 - AI Coding 不只是工具升級, 區域醫院醫療資訊系統協作開發與資訊團隊轉型實踐
cclai999
0
150
Featured
See All Featured
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
Design in an AI World
tapps
1
360
HTML-Aware ERB: The Path to Reactive Rendering @ RubyCon 2026, Rimini, Italy
marcoroth
5
840
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
287
14k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
12
1.3k
Making the Leap to Tech Lead
cromwellryan
135
10k
The Cost Of JavaScript in 2023
addyosmani
55
10k
Gemini Prompt Engineering: Practical Techniques for Tangible AI Outcomes
mfonobong
2
590
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
38
3.1k
The SEO Collaboration Effect
kristinabergwall1
1
600
Effective software design: The role of men in debugging patriarchy in IT @ Voxxed Days AMS
baasie
1
580
16th Malabo Montpellier Forum Presentation
akademiya2063
PRO
0
420
Transcript
Using Kotlin in Android Ivan W.
Outline • Null Safety • Data Class • Default Argument
/ Implementation 2
Null Safety • Eliminate the danger of null references from
code • Nullable types and Non-Null Types var a: String = "abc" a = null // compilation error var b: String? = "abc" b = null // ok 3 Nullable types Non-Null types
Example 1 4 Bundle args = getArguments(); if (args !=
null) { Bundle data = args.getBundle(KEY_DATA); if (data != null) { Log.d(TAG, data.getString(KEY_NAME)); } } Java
Example 1 5 Bundle args = getArguments(); if (args !=
null) { Bundle data = args.getBundle(KEY_DATA); if (data != null) { Log.d(TAG, data.getString(KEY_NAME)); } } Log.d(TAG, arguments?.getBundle(KEY_DATA)?.getString(KEY_NAME)) Java Kotlin
Data Class • It automatically generates ◦ equals() / hashCode()
◦ getters and setters ◦ toString() ◦ copy()
Example 2 7 Java Kotlin See example See example
Default Argument / Implementation 8 • Java overloads can be
replaced with one function in Kotlin
Example 3 9 private void sendInfo(String content, long Time, String
tag) { /* ... */ } private void sendInfo(String content, long Time) { /* ... */ } private void sendInfo(String content, String tag) { /* ... */ } private void sendInfo(String content) { /* ... */ } Java
Example 3 10 private fun sendInfo( content: String, time: Long
= Date().time, tag: String = TAG ) { … } sendInfo("content", time = Date().time) Kotlin
Example 4 11 Java Kotlin See example See example
Thank you! 12