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
0
1.6k
Modern Java Libraries with Kotlin
potatotips #40
Keisuke Kobayashi
May 24, 2017
Tweet
Share
More Decks by Keisuke Kobayashi
See All by Keisuke Kobayashi
今日から始める依存性の注入 / First Time Dependency Injection
kobakei
26
7.5k
iOSアプリの技術的負債をどう返済したか / How to repay the technical debt of iOS app
kobakei
2
970
iOSアプリ内で不正なSSL証明書を検知する / SSL Pinning for iOS apps
kobakei
34
12k
Kyashアプリ開発の現場
kobakei
4
2.8k
Review of Google I/O 2017 & Prepare for Google I/O 2018
kobakei
0
320
APIクライアントをCodableで置き換えた話
kobakei
0
1.6k
開発者が知っておきたい通知の歴史
kobakei
9
7.6k
mockito-kotlin
kobakei
1
530
2017年に新規アプリを立ち上げた話
kobakei
2
1.1k
Other Decks in Programming
See All in Programming
実践!App Intents対応
yuukiw00w
1
350
Namespace and Its Future
tagomoris
4
280
Laravel Boost 超入門
fire_arlo
1
130
物語を動かす行動"量" #エンジニアニメ
konifar
14
5.5k
ワープロって実は計算機で
pepepper
2
1.4k
ライブ配信サービスの インフラのジレンマ -マルチクラウドに至ったワケ-
mirrativ
2
260
LLMOpsのパフォーマンスを支える技術と現場で実践した改善
po3rin
8
980
コーディングエージェント時代のNeovim
key60228
1
100
20250808_AIAgent勉強会_ClaudeCodeデータ分析の実運用〜競馬を題材に回収率100%の先を目指すメソッドとは〜
kkakeru
0
210
フロントエンドのmonorepo化と責務分離のリアーキテクト
kajitack
2
140
AI OCR API on Lambdaを Datadogで可視化してみた
nealle
0
180
自作OSでDOOMを動かしてみた
zakki0925224
1
1.4k
Featured
See All Featured
Reflections from 52 weeks, 52 projects
jeffersonlam
351
21k
Visualization
eitanlees
147
16k
Agile that works and the tools we love
rasmusluckow
329
21k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
656
61k
Six Lessons from altMBA
skipperchong
28
4k
Practical Orchestrator
shlominoach
190
11k
Building a Modern Day E-commerce SEO Strategy
aleyda
43
7.5k
The Invisible Side of Design
smashingmag
301
51k
Making the Leap to Tech Lead
cromwellryan
134
9.5k
The World Runs on Bad Software
bkeepers
PRO
70
11k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
18
1.1k
Raft: Consensus for Rubyists
vanstee
140
7.1k
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!