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
開発 4 年目のアプリへの Kotlin 導入
Search
Ryutaro Miyashita
January 26, 2018
Technology
0
410
開発 4 年目のアプリへの Kotlin 導入
DroidKaigi Prelude #dk_prelude
Ryutaro Miyashita
January 26, 2018
Tweet
Share
More Decks by Ryutaro Miyashita
See All by Ryutaro Miyashita
Java で書かれた Android アプリを Kotlin で書き直すまでの話 / Talk of rewrite Android app for Java to Kotlin
ryugoo
0
1.6k
チーム開発と Android アプリの構成
ryugoo
5
1.2k
開発 4 年目のアプリへの Kotlin 導入
ryugoo
1
2.6k
Either で想定内のエラーと想定外のエラーを別ものにしたい!
ryugoo
2
1.6k
全て S になる -RxJava と LWS を持ち込む楽しさ-
ryugoo
4
720
Transition at RxJava 1.x to 2.x
ryugoo
0
520
Kotlin さんと誕生日が近いだけの男の話
ryugoo
2
500
Android エンジニアになって 2 年の学び
ryugoo
1
2.6k
年末だしお掃除をしよう!
ryugoo
0
770
Other Decks in Technology
See All in Technology
LINEスキマニにおけるフロントエンド開発
lycorptech_jp
PRO
0
330
宇宙ベンチャーにおける最近の情シス取り組みについて
axelmizu
0
110
C++26 エラー性動作
faithandbrave
2
730
Fanstaの1年を大解剖! 一人SREはどこまでできるのか!?
syossan27
2
170
Snykで始めるセキュリティ担当者とSREと開発者が楽になる脆弱性対応 / Getting started with Snyk Vulnerability Response
yamaguchitk333
2
180
ガバメントクラウドのセキュリティ対策事例について
fujisawaryohei
0
540
podman_update_2024-12
orimanabu
1
270
Turing × atmaCup #18 - 1st Place Solution
hakubishin3
0
480
コンテナセキュリティのためのLandlock入門
nullpo_head
2
320
Snowflake女子会#3 Snowpipeの良さを5分で語るよ
lana2548
0
230
UI State設計とテスト方針
rmakiyama
2
580
KubeCon NA 2024 Recap: How to Move from Ingress to Gateway API with Minimal Hassle
ysakotch
0
200
Featured
See All Featured
How STYLIGHT went responsive
nonsquared
95
5.2k
Git: the NoSQL Database
bkeepers
PRO
427
64k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
45
2.2k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
356
29k
Fireside Chat
paigeccino
34
3.1k
Six Lessons from altMBA
skipperchong
27
3.5k
Imperfection Machines: The Place of Print at Facebook
scottboms
266
13k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
28
9.1k
Why You Should Never Use an ORM
jnunemaker
PRO
54
9.1k
Thoughts on Productivity
jonyablonski
67
4.4k
A Modern Web Designer's Workflow
chriscoyier
693
190k
Building a Modern Day E-commerce SEO Strategy
aleyda
38
7k
Transcript
։ൃͷΞϓϦͷ,PUMJOಋೖ %SPJE,BJHJ1SFMVEF!%F/"
ٶԼཽେ $IBU8PSLגࣜձࣾ ΫϥΠΞϯτΞϓϦέʔγϣϯ։ൃ෦ !SZVHPP@
,PUMJO
։ൃͷΞϓϦͷ,PUMJOಋೖ ‣ ͷ(PPHMF*0Ͱެࣜ։ൃݴޠԽͨ͠ Ҏલ͔Βಋೖݕ౼͍ͯͨ͠ ެࣜαϙʔτ͕ಘΒΕͨ͜ͱͰ҆৺Λಘͨ ཌ͔ΒಋೖΛ։࢝ͨ͠ʜ͔͠͠ʜ ‣
طଘͷΞϓϦͷಋೖͲ͏ͨ͠Βྑ͍ͷ͔ʁ Ͳ͔͜Βʁ શͯॻ͖͑Δʁ ϋοΩϦ͍ͯ͠ͳ͍͕ɺͬͯΈΑ͏
݁શͯ,PUMJOԽͨ͠ํ͕ϝϦοτ͕େ͖͍ ‣ ಋೖॳશͯΛ,PUMJOԽ͢Δ༧ఆແ͔ͬͨ ͡Ί৽ن%JBMPH'SBHNFOU͔Β։࢝ ࣍ʹطଘͷ"DUJWJUZΛ,PUMJOԽ ͦͷޙɺ৽نίʔυΛ,PUMJOͰՃ ‣
+BWBͱͷͭͳ͗ࠐΈ͕ωοΫʹͳ͍ͬͯ͘ !+WN'JFME!+WN4UBUJD!+WN0WFSMPBET SFUVSO6OJU*/45"/$& 1MBUGPSN5ZQFT
݁શͯ,PUMJOԽͨ͠ํ͕ϝϦοτ͕େ͖͍ ‣ !+WN'JFME!+WN4UBUJD!+WN0WFSMPBET DPNQBOJPOPCKFDUதʹॻ͘ͱTUBUJDʹల։ class SomeFragment : Fragment() {
companion object { @JvmField val TAG: String = SomeFragment::class.java.simpleName } }
݁શͯ,PUMJOԽͨ͠ํ͕ϝϦοτ͕େ͖͍ ‣ !+WN'JFME!+WN4UBUJD!+WN0WFSMPBET DPNQBOJPOPCKFDUதʹॻ͘ͱTUBUJDʹల։ class SomeFragment : Fragment() {
companion object { @JvmStatic fun newInstance() = SomeFragment() } }
݁શͯ,PUMJOԽͨ͠ํ͕ϝϦοτ͕େ͖͍ ‣ !+WN'JFME!+WN4UBUJD!+WN0WFSMPBET σϑΥϧτҾ͕͋Δ͚ͩΦʔόʔϩʔυ class SomeFragment : Fragment() {
companion object { @JvmStatic @JvmOverloads fun newInstance(id: Long, name: String = "") = SomeFragment() } }
݁શͯ,PUMJOԽͨ͠ํ͕ϝϦοτ͕େ͖͍ ‣ SFUVSO6OJU*/45"/$& ؔΛҾʹऔΔॲཧΛ+BWB͔Βݺͼग़͢ͱʁ class Model { fun async(callback:
() -> Unit) { // Some asynchronous processing callback() } }
݁શͯ,PUMJOԽͨ͠ํ͕ϝϦοτ͕େ͖͍ ‣ SFUVSO6OJU*/45"/$& lWPJEzͳ͍ͷͰɺl6OJUzΛฦ͢ඞཁ͕͋Δ Model model = new Model();
model.async(() -> { // Some callback processing return Unit.INSTANCE; });
IUUQTEJTDVTTLPUMJOMBOHPSHUKBWBJOUFSPQVOJUDMPTVSFTSFRVJSFEUPSFUVSOLPUMJOVOJU !+WN7PJEͷఏҊ ʹಉ͡ఏى
݁શͯ,PUMJOԽͨ͠ํ͕ϝϦοτ͕େ͖͍ ‣ 1MBUGPSN5ZQFT /PO/VMM·ͨ/VMMBCMF͔͠Εͳ͍ܕ "OESPJE4%,جຊతʹ1MBUGPSN5ZQFT !/PO/VMM!/VMMBCMF͕͍͍ͯΕϋοϐʔ val
inflater = LayoutInflater.from(this) ˡฦΓʹlz͕͍͍ͯΔ
݁શͯ,PUMJOԽͨ͠ํ͕ϝϦοτ͕େ͖͍ ‣ "OESPJE4%,Ͱ͋ΕதΛݟΔ public static LayoutInflater from(Context context) { LayoutInflater
LayoutInflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); if (LayoutInflater == null) { throw new AssertionError("LayoutInflater not found."); } return LayoutInflater; } val inflater: LayoutInflater = LayoutInflater.from(this) ˡͲ͏ΒOVMMʹͳΒͳ͍Β͍͠ ˣ/PO/VMMܕͱͯ͠ѻ͏Α͏ʹ͢Δ
݁શͯ,PUMJOԽͨ͠ํ͕ϝϦοτ͕େ͖͍ ‣ "OESPJE4%,Ͱ͋ΕதΛݟΔ lTPVSDFTz͕͋ΔͳΒ"OESPJE4UVEJPͰ $ISPNFͷ"OESPJE4%,4FBSDIΦεεϝ ‣ IUUQCJUMZBOESPJETELTFBSDI
݁શͯ,PUMJOԽͨ͠ํ͕ϝϦοτ͕େ͖͍ ‣ "OESPJE4%,Ͱ͋ΕதΛݟΔ lTPVSDFTz͕͋ΔͳΒ"OESPJE4UVEJPͰ $ISPNFͷ"OESPJE4%,4FBSDIΦεεϝ ‣ IUUQCJUMZBOESPJETELTFBSDI ˡιʔεϑΝΠϧͷϦϯΫ͕͘
݁શͯ,PUMJOԽͨ͠ํ͕ϝϦοτ͕େ͖͍ ‣ ࣗୡ͕ॻ͍ͨίʔυʁ !/PO/VMM!/VMMBCMFΛ͚͍ͯ͘ʁ ͍ͬͦͷ͜ͱ,PUMJOʹͯ͠͠·ͬͨํ͕ʁ ‣ ͭͣͭ,PUMJOԽ͍ͯ͘͠
ؔ࿈͢Δ+BWBʹΞ ϊςʔγϣϯΛ͚Δ যΒͣɺΏͬ͘ΓͱͰશͯΛ,PUMJOԽ͢Δ
ݱঢ়
+BWBͷΛ,PUMJOԽ ‣ ϲ݄Ͱؒʹॻ͍ͨ+BWBͷ͕,PUMJOԽ ‣ ϑΝΠϧ ,PUMJO +BWB
+BWBͷΛ,PUMJOԽ ‣ ϲ݄Ͱؒʹॻ͍ͨ+BWBͷ͕,PUMJOԽ ‣ νʔϜͷޮՌ /PO/VMM/VMMBCMFΛڧ͘ҙࣝ͢ΔΑ͏ʹͳͬͨ ‣ !/PO/VMM!/VMMBCMFΞ ϊςʔγϣϯͷ͚Ε͕ͳ͍
‣ ݴޠػೳʹ/VMMTBGFUZ͕͋Δํ͕Εͳ͍͠ҙࣝ͢Δ ‣ ͜Ε·Ͱ+BWBͰ0QUJPOBM"1*͍ͬͯͨ ‣ ͨͩɺ0QUJPOBMΛ͍ͬͯΔͱ,PUMJOଆͰ໘ʜʜ
+BWBͷΛ,PUMJOԽ ‣ ϲ݄Ͱؒʹॻ͍ͨ+BWBͷ͕,PUMJOԽ ‣ νʔϜͷޮՌ ൣғͷWBSΛආ͚ΔΑ͏ʹͳͬͨ ‣ ΠϯελϯεϓϩύςΟͰ͖Δ͚ͩWBM ‣
ϝιουͳͲڱ͍ൣғͰWBS͍ͬͯΔ ‣ -JTU.VUBCMF-JTUͳͲҙࣝతʹ͍͚Λ͍ͯ͠Δ
͓͠·͍ %SPJE,BJHJ1SFMVEF!%F/"