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
400
開発 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.1k
開発 4 年目のアプリへの Kotlin 導入
ryugoo
1
2.5k
Either で想定内のエラーと想定外のエラーを別ものにしたい!
ryugoo
2
1.6k
全て S になる -RxJava と LWS を持ち込む楽しさ-
ryugoo
4
710
Transition at RxJava 1.x to 2.x
ryugoo
0
510
Kotlin さんと誕生日が近いだけの男の話
ryugoo
2
500
Android エンジニアになって 2 年の学び
ryugoo
1
2.6k
年末だしお掃除をしよう!
ryugoo
0
760
Other Decks in Technology
See All in Technology
隣接領域をBeyondするFinatextのエンジニア組織設計 / beyond-engineering-areas
stajima
1
270
Amplify Gen2 Deep Dive / バックエンドの型をいかにしてフロントエンドへ伝えるか #TSKaigi #TSKaigiKansai #AWSAmplifyJP
tacck
PRO
0
370
Terraform未経験の御様に対してどの ように導⼊を進めていったか
tkikuchi
2
430
適材適所の技術選定 〜GraphQL・REST API・tRPC〜 / Optimal Technology Selection
kakehashi
1
160
OCI 運用監視サービス 概要
oracle4engineer
PRO
0
4.8k
Making your applications cross-environment - OSCG 2024 NA
salaboy
0
180
Terraform Stacks入門 #HashiTalks
msato
0
350
RubyのWebアプリケーションを50倍速くする方法 / How to Make a Ruby Web Application 50 Times Faster
hogelog
3
940
[FOSS4G 2019 Niigata] AIによる効率的危険斜面抽出システムの開発について
nssv
0
310
20241120_JAWS_東京_ランチタイムLT#17_AWS認定全冠の先へ
tsumita
2
240
Lambdaと地方とコミュニティ
miu_crescent
2
370
フルカイテン株式会社 採用資料
fullkaiten
0
40k
Featured
See All Featured
Ruby is Unlike a Banana
tanoku
97
11k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
26
2.1k
No one is an island. Learnings from fostering a developers community.
thoeni
19
3k
Speed Design
sergeychernyshev
24
610
Designing Experiences People Love
moore
138
23k
Practical Orchestrator
shlominoach
186
10k
YesSQL, Process and Tooling at Scale
rocio
169
14k
Scaling GitHub
holman
458
140k
Rails Girls Zürich Keynote
gr2m
94
13k
Building Adaptive Systems
keathley
38
2.3k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
28
2k
jQuery: Nuts, Bolts and Bling
dougneiner
61
7.5k
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/"