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
The Rise of LLMOps
asei
7
1.5k
B2B SaaSから見た最近のC#/.NETの進化
sansantech
PRO
0
780
安心してください、日本語使えますよ―Ubuntu日本語Remix提供休止に寄せて― 2024-11-17
nobutomurata
1
990
EventHub Startup CTO of the year 2024 ピッチ資料
eventhub
0
110
TypeScript、上達の瞬間
sadnessojisan
46
13k
Amplify Gen2 Deep Dive / バックエンドの型をいかにしてフロントエンドへ伝えるか #TSKaigi #TSKaigiKansai #AWSAmplifyJP
tacck
PRO
0
380
Taming you application's environments
salaboy
0
190
SREによる隣接領域への越境とその先の信頼性
shonansurvivors
2
520
マルチモーダル / AI Agent / LLMOps 3つの技術トレンドで理解するLLMの今後の展望
hirosatogamo
37
12k
ドメインの本質を掴む / Get the essence of the domain
sinsoku
2
150
Lambdaと地方とコミュニティ
miu_crescent
2
370
サイバーセキュリティと認知バイアス:対策の隙を埋める心理学的アプローチ
shumei_ito
0
380
Featured
See All Featured
Become a Pro
speakerdeck
PRO
25
5k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
31
2.7k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
Testing 201, or: Great Expectations
jmmastey
38
7.1k
The Cult of Friendly URLs
andyhume
78
6k
Raft: Consensus for Rubyists
vanstee
136
6.6k
Scaling GitHub
holman
458
140k
No one is an island. Learnings from fostering a developers community.
thoeni
19
3k
Fantastic passwords and where to find them - at NoRuKo
philnash
50
2.9k
Statistics for Hackers
jakevdp
796
220k
5 minutes of I Can Smell Your CMS
philhawksworth
202
19k
The Cost Of JavaScript in 2023
addyosmani
45
6.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/"