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.1k
開発 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
OpenAIの蒸留機能(Model Distillation)を使用して運用中のLLMのコストを削減する取り組み
pharma_x_tech
4
550
Oracle Cloudの生成AIサービスって実際どこまで使えるの? エンジニア目線で試してみた
minorun365
PRO
4
280
小学3年生夏休みの自由研究「夏休みに Copilot で遊んでみた」
taichinakamura
0
150
WACATE2024冬セッション資料(ユーザビリティ)
scarletplover
0
190
Amazon Kendra GenAI Index 登場でどう変わる? 評価から学ぶ最適なRAG構成
naoki_0531
0
100
継続的にアウトカムを生み出し ビジネスにつなげる、 戦略と運営に対するタイミーのQUEST(探求)
zigorou
0
520
re:Invent 2024 Innovation Talks(NET201)で語られた大切なこと
shotashiratori
0
300
PHP ユーザのための OpenTelemetry 入門 / phpcon2024-opentelemetry
shin1x1
1
160
20241220_S3 tablesの使い方を検証してみた
handy
3
360
コンテナセキュリティのためのLandlock入門
nullpo_head
2
320
バクラクのドキュメント解析技術と実データにおける課題 / layerx-ccc-winter-2024
shimacos
2
1.1k
[Ruby] Develop a Morse Code Learning Gem & Beep from Strings
oguressive
1
150
Featured
See All Featured
Faster Mobile Websites
deanohume
305
30k
How STYLIGHT went responsive
nonsquared
95
5.2k
Intergalactic Javascript Robots from Outer Space
tanoku
270
27k
Building Your Own Lightsaber
phodgson
103
6.1k
Site-Speed That Sticks
csswizardry
2
190
No one is an island. Learnings from fostering a developers community.
thoeni
19
3k
For a Future-Friendly Web
brad_frost
175
9.4k
The Language of Interfaces
destraynor
154
24k
Automating Front-end Workflow
addyosmani
1366
200k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
226
22k
The Invisible Side of Design
smashingmag
298
50k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
2
170
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/"