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
Modern Java Libraries with Kotlin
Search
Keisuke Kobayashi
May 24, 2017
Programming
1.7k
0
Share
Modern Java Libraries with Kotlin
potatotips #40
Keisuke Kobayashi
May 24, 2017
More Decks by Keisuke Kobayashi
See All by Keisuke Kobayashi
AI 1st でエンタープライズ SaaS を立ち上げる / AI 1st Enterprise SaaS
kobakei
1
210
プロダクト開発をAI 1stに変革する〜SaaS is dead時代で生き残るために〜 / AI 1st Product Development
kobakei
0
2.7k
今日から始める依存性の注入 / First Time Dependency Injection
kobakei
26
7.7k
iOSアプリの技術的負債をどう返済したか / How to repay the technical debt of iOS app
kobakei
2
1k
iOSアプリ内で不正なSSL証明書を検知する / SSL Pinning for iOS apps
kobakei
34
12k
Kyashアプリ開発の現場
kobakei
4
2.9k
Review of Google I/O 2017 & Prepare for Google I/O 2018
kobakei
0
340
APIクライアントをCodableで置き換えた話
kobakei
0
1.6k
開発者が知っておきたい通知の歴史
kobakei
9
7.9k
Other Decks in Programming
See All in Programming
Inside Stream API
skrb
1
480
CLIであることを活かしたGitHub Copilot CLI活用術 / GitHub Copilot CLI Pro Tips & Tricks
nao_mk2
1
1.2k
今さら聞けないCancellationToken
htkym
0
210
開発体験を左右するライブラリの API 設計 - GraphQL スキーマ構築ライブラリから考える #tskaigi
izumin5210
2
1.5k
正しくソフトウェアを作る、前提を疑うための認知の視点 / doubt-premise
minodriven
5
2.2k
自動レビューエンジンの実装と運用 ~レビューのない世界へ~
kurukuru1999
2
310
「エンジニアインターン、どうやって取った?」準備のリアルを語るLT会 Progate BAR
akiomatic
0
110
[2026年度第1回ORセミナー] 計画最適化ベンチャーと競技プログラミング人材
terryu16
0
220
次世代リンターで探る、tsgo 時代における型認識カスタムルールの現実解
ytakahashii
3
1.4k
JJUG CCC 2026 Spring: JSpecify で実現する Kotlin フレンドリーな Java API 設計
ternbusty
1
120
AI時代のUIはどこへ行く?その2!
yusukebe
18
5.8k
Why Laravel apps break—Mastering the fundamentals to keep them maintainable
kentaroutakeda
1
330
Featured
See All Featured
Digital Ethics as a Driver of Design Innovation
axbom
PRO
1
300
Game over? The fight for quality and originality in the time of robots
wayneb77
1
180
What Being in a Rock Band Can Teach Us About Real World SEO
427marketing
0
240
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
34
2.8k
Become a Pro
speakerdeck
PRO
31
6k
Digital Projects Gone Horribly Wrong (And the UX Pros Who Still Save the Day) - Dean Schuster
uxyall
0
1.5k
How to Get Subject Matter Experts Bought In and Actively Contributing to SEO & PR Initiatives.
livdayseo
0
130
B2B Lead Gen: Tactics, Traps & Triumph
marketingsoph
0
130
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
2.9k
The Cult of Friendly URLs
andyhume
79
6.9k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
My Coaching Mixtape
mlcsv
0
140
Transcript
Modern Java Libraries with Kotlin Keisuke Kobayashi / @kobakei potatotips
#40
About me • Keisuke Kobayashi • GitHub, Qiita: @kobakei •
Twitter: @kobakei122 • Kyash, Inc
None
ࠓ͢͜ͱ • ݪଇJavaϥΠϒϥϦKotlinͰ େମͦͷ··͑·͢ • Ұ෦ಛผʹରԠ͕ඞཁͳͷΛհ͠·͢
Dagger2 + Orma
Dagger2 + Orma • kaptͰࣗಈੜ͞ΕΔΫϥεDaggerͰ provideͰ͖ͳ͍ • ͭ·ΓOrmaDatabase
NG: Ϗϧυ͕௨Βͳ͍ @Module class AppModule(private val context: Context) { @Singleton
@Provides fun provideOrmaDatabase(context: Context): OrmaDatabase { return OrmaDatabase.builder(context).build() } }
ղܾࡦ • OrmaDatabaseΛϥοϓ͢Δ͚ͩͷΫϥεΛ ࡞ͬͯɺͦΕΛprovide͢Δ
OrmaHolder class OrmaHolder(val context: Context) { val ormaDatabase = OrmaDatabase.builder(context).build()
}
Dagger Module @Module class AppModule(private val context: Context) { @Singleton
@Provides fun provideOrmaHolder(context: Context): OrmaHolder { return OrmaHolder(context) } }
Data Binding
Data binding • dependenciesʹkaptͰՃ android { dataBinding { enabled true
} } dependencies { kapt 'com.android.databinding:compiler:x.y.z' }
Parceler
Parceler • ParcelableͷϘΠϥʔϓϨʔτΛࣗಈੜ͢Δ ϥΠϒϥϦ • data classͰParcelerΛ͍͍ͨ
data class • toString, hasCodeͷ࣮ෆཁ data class User ( val
email: String?, val userName: String?, )
data class with Parceler • ͜Εͩͱಈ͔ͳ͍ʢϓϩύςΟ͋Δ͕ϑΟʔϧυ Ͱͳ͍ͨΊʣ @Parcel data class
User ( val email: String?, val userName: String?, )
data class with Parceler • ͜ΕͰϓϩύςΟܦ༝ͰಡΈॻ͖ͯ͘͠ΕΔ @Parcel(Parcel.Serialization.BEAN) data class User
@ParcelConstructor constructor( val email: String?, val userName: String?, )
͓·͚: αϯϓϧॻ͖·ͨ͠ • https://github.com/kobakei/Android-Kotlin- Example
Thanks!