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
チーム開発と Android アプリの構成
Search
Ryutaro Miyashita
July 14, 2017
Programming
5
1.1k
チーム開発と Android アプリの構成
第4回スタートアップAndroid勉強会
https://connpass.com/event/59928/
Ryutaro Miyashita
July 14, 2017
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
開発 4 年目のアプリへの Kotlin 導入
ryugoo
0
400
開発 4 年目のアプリへの Kotlin 導入
ryugoo
1
2.5k
Either で想定内のエラーと想定外のエラーを別ものにしたい!
ryugoo
2
1.6k
全て S になる -RxJava と LWS を持ち込む楽しさ-
ryugoo
4
690
Transition at RxJava 1.x to 2.x
ryugoo
0
510
Kotlin さんと誕生日が近いだけの男の話
ryugoo
2
490
Android エンジニアになって 2 年の学び
ryugoo
1
2.6k
年末だしお掃除をしよう!
ryugoo
0
760
Other Decks in Programming
See All in Programming
sqlcを利用してsqlに型付けを
kamiyam
0
240
Serverless renderování Webových komponent
rarous
PRO
0
100
ML-прайсинг_на_Lamoda__вошли_и_вышли__приключение_на_20_минут__Слава_Цыганков.pdf
lamodatech
0
180
App Router 悲喜交々
quramy
7
380
AWS CDKを用いたセキュアなCI/CDパイプラインの構築 / Build a secure CI/CD pipeline using AWS CDK
seike460
PRO
3
620
2024-10-01 dev2next - Observability for Modern JVM Applications
jonatan_ivanov
0
130
Taking LLMs out of the black box: A practical guide to human-in-the-loop distillation
inesmontani
PRO
3
1.2k
Kubernetes上でOracle_Databaseの運用を楽にするOraOperatorの紹介
nnaka2992
0
150
クラウドサービスの 利用コストを削減する技術 - 円安の真南風を感じて -
pyama86
3
390
2024-10-02 dev2next - Application Observability like you've never heard before
jonatan_ivanov
0
180
Pydantic x Database API:turu-pyの開発
yassun7010
1
670
MLOps in Mercari Group’s Trust and Safety ML Team
cjhj
1
120
Featured
See All Featured
Designing Dashboards & Data Visualisations in Web Apps
destraynor
228
52k
Product Roadmaps are Hard
iamctodd
PRO
48
10k
Happy Clients
brianwarren
97
6.7k
Code Reviewing Like a Champion
maltzj
519
39k
Building a Modern Day E-commerce SEO Strategy
aleyda
38
6.8k
Facilitating Awesome Meetings
lara
49
6k
Imperfection Machines: The Place of Print at Facebook
scottboms
264
13k
Code Review Best Practice
trishagee
62
16k
What the flash - Photography Introduction
edds
67
11k
Learning to Love Humans: Emotional Interface Design
aarron
272
40k
It's Worth the Effort
3n
183
27k
How STYLIGHT went responsive
nonsquared
95
5.1k
Transcript
νʔϜ։ൃͱ"OESPJEΞϓϦͷߏ ୈճελʔτΞοϓ"OESPJEษڧձ ελʔτΞοϓʹ͓͚ΔΞʔΩςΫνϟͱͷ͖߹͍ํ
ٶԼཽେ $IBU8PSLגࣜձࣾ ΞϓϦέʔγϣϯ։ൃ෦νʔϜϦʔμʔ !SZVHPP@
ߏ
"OESPJEΞϓϦͷߏ ΞʔΩςΫνϟ ύοέʔδߏ
ΞʔΩςΫνϟ .7$ .71 .77. 'MVY 7*1&3 $MFBO"SDIJUFDUVSF FUD
ϥΠϑαΠΫϧʹண͢ΔΞʔΩςΫνϟ ‣ 3Y+BWB&WFOU#VTΛ͍ͬͯΕҙࣝ͢Δͣ PO4UBSUPO4UPQͰTVCTDSJCFVOTVCTDSJCF ߪಡ͕ഁغ͞Εͨͱ͖ͷࢹରͷదͳഁغ ‣ ϥΠϑαΠΫϧʹண͢Δͱ͞Βʹҙࣝ͢Δ͜ͱ
ׂͷ ը໘ͱใ ใͱϩδοΫ ϩδοΫͱӬଓԽػߏ
"OESPJE"SDIJUFDUVSF$PNQPOFOUT ‣ (PPHMF*0Ͱൃද͞Εͨ ‣ (PPHMFͷߟ͑ΔਪનΞʔΩςΫνϟ ‣ "DUJWJUZ'SBHNFOUͷϥΠϑαΠΫϧʹண ؍ଌՄೳͳϥΠϑαΠΫϧͱඥ͘σʔλ -JGFDZDMF-JWF%BUB
ը໘ճసʹӨڹ͞Εͳ͍σʔλͷอ࣋ 7JFX.PEFM σʔλͷӬଓԽΛखॿ͚͢Δ 3PPN1FSTJTUFODF-JCSBSZ
ΞʔΩςΫνϟࣅͯ͘Δ ‣ "DUJWJUZ'SBHNFOU$VTUPN7JFX 7JFX6*ͷ੍ޚʹूத͢Δ ‣ 7JFX.PEFM 7JFXͷͨΊͷΛอ࣋͢Δ
7JFXͱϏδωεϩδοΫͷڮ͠ ‣ #VTJOFTT-PHJD ΦϒδΣΫτ ϏδωεϩδοΫ
7JFX 7JFX.PEFM #VTJOFTT-PHJD ‣ 3Y+BWB ‣ JOUFSGBDF ‣ &WFOU#VT
7JFX 7JFX.PEFM #VTJOFTT-PHJD ‣ 3Y+BWB ‣ JOUFSGBDF ‣ &WFOU#VT
"OESPJEͷ7JFX͍͜͠ ‣ "DUJWJUZ 'SBHNFOU %JBMPH'SBHNFOU #PUUPN4IFFU $VTUPN7JFX ‣
ը໘ͷίϯϙʔωϯτಉ࢜௨৴͕ඞཁ 7JFX.PEFMΛͲͷΑ͏ʹ͏͔ %BUB#JOEJOHͱͲ͏Έ߹ΘͤΔ͔
7JFX.PEFMΛͲͷΑ͏ʹ͏͔ ‣ Ϣʔβʔ͕ݟ͍ͯΔlը໘zʹؔ৺Λ͚Δ ʷ )PHF"DUJWJUZ⾮)PHF"DUJWJUZ7JFX.PEFM ̋ )PHF"DUJWJUZ )PHF'SBHNFOU )PHF$VTUPN7JFX )PHF7JFX.PEFM
lը໘zͷؔ৺ʹରͯ͠7JFX.PEFM͕͋Δ ۃྗ"OESPJE߹ʹҾͬுΒΕͨ͘ͳ͍
7JFX.PEFMΛͲͷΑ͏ʹ͏͔ ‣ "OESPJE"SDIJUFDUVSF$PNQPOFOUT 7JFX.PEFM1SPWJEFSTܦ༝Ͱڞ༗Ͱ͖Δ class MyFragment: Fragment() { val
viewModel: MyViewModel by lazy { ViewModelProviders.of(activity) .get(MyViewModel::class.java) } }
%BUB#JOEJOHͱͲ͏Έ߹ΘͤΔ͔ ‣ ֤ϨΠΞτͱ7JFX.PEFMΛόΠϯυ 7JFX.PEFMը໘ͷτοϓίϯϙʔωϯτ͔Βऔಘ <?xml version="1.0" encoding="utf-8"?> <layout> <data>
<variable name="hogeViewModel" type="com.example.view.hoge.HogeViewModel"/> </data> </layout>
%BUB#JOEJOHͱͲ͏Έ߹ΘͤΔ͔ ‣ 0CTFSWBCMF'JFMEͳͲͬͯํόΠϯυ <TextView android:text="@={hogeViewModel.textValue}"> data class HogeViewModel( val textValue:
ObservableField<String> = ObservableField() )
7JFXͱ7JFX.PEFM )PHF "DUJWJUZ )PHF 'SBHNFOU )PHF 7JFX l)PHFz %BUB#JOEJOH l)PHF7JFX.PEFMz
0CTFSWBCMF'JFME SY0CTFSWBCMF $PNNBOE &WFOU
Έ ‣ Ϣʔβʔ͕ݟ͍ͯΔlը໘zʹؔ৺Λ͚Δ Ͳ͜·Ͱ͕ಉ͡ίϯςΩετͷը໘ͳͷ͔ )PHF"DUJWJUZ͕ΞΫςΟϒͰ͋Εɺ ͦ͜ʹදࣔ͞ΕΔͷಉ͡ίϯςΩετʁ ྫ͑l%JBMPH'SBHNFOUzͲ͏ͩΖ͏ʁ
)PHF7JFX.PEFMΛ͖͔࣋ͭ൱͔ ઐ༻ͷ7JFX.PEFM͕͋ͬͨํ͕ྑ͍ͷ͔ දࣔ͞ΕΔ%JBMPHͷதͰมΘΓͦ͏͚ͩͲ ʅЏʆʀ řŖƃʜ
ύοέʔδߏ
ύοέʔδߏ ‣ "OESPJEΞϓϦͷύοέʔδߏࣗ༝͕ߴ͍ ϓϩδΣΫτσϑΥϧτͰ.BJO"DUJWJUZ͕ ύοέʔδԼʹυʔϯͱஔ͔Ε͍ͯΔ ‣ ྫ͑044ͳ"OESPJEϓϩδΣΫτͰʁ - root
- ui - activities - fragments - views - viewmodels - root - ui - Activity.java - Fragment.java - model - utils
Ͳ͜ʹ͢Δ͔ ‣ ύοέʔδߏΛͲ͏ׂ͢Δ͔ lVJzlNPEFMzʹ͚Δͷྑ͋͘Δ ͔Γ͍͢ ‣ Ͱ
lBDUJWJUZzͳͲͰ͚͍ͯ͘ͷ͕ຊʹྑ͍ͷ͔ lը໘zʹண͢Δͱίʔυ͕ࢄͯ͘͠Δ ͞ΒʹlWJFXNPEFMzग़ͯ͘Δͱʜʜʁ ̻̻̻ƅЧƅ űŘŎŎŎ
ఏҊ ‣ Ϣʔβʔ͕ண͢Δը໘Λߏ͢ΔཁૉͰ·ͱΊΔ - root - ui - hoge -
HogeActivity.kt - HogeFragment.kt - HogeCustomView.kt - HogeViewModel.kt - fuga - ……
ఏҊ ‣ ϝϦοτ ύοέʔδϓϥΠϕʔτʹͰ͖Δ ը໘Λߏ͢ΔཁૉͰ·ͱΊΒΕΔͷͰࢄΒΒͳ͍ (JU)VCͷ3FQPTJUPSZ7JFXFSͰݟΔͱָ͖ʑ ‣
σϝϦοτ ࢥ͍͔ͭͳ͍ʂ
ʹΌΜͳΜͷͨΊʹ
ͳͥlΞʔΩςΫνϟzʹ͢Δͷ͔ ‣ ਓͳΒ ଟ ͲΜͳܗͰͳ͍ ਓ ਓʜʜνʔϜʹͳ͖ͬͯͨΒʁ டং͕ඞཁ
ΞʔΩςΫνϟடং νʔϜͷͨΊʹΞʔΩςΫνϟ͕͋Δ ‣ டং͕ͳ͍ͱͲ͏ͳΔͷ͔ ։ൃ͕མͪɺόάੜ·ΕɺΧΦεʹͳΔ ϢʔβʔͷՁఏڙ͕ૄ͔ʹͳΔ
ελʔτΞοϓͱΞʔΩςΫνϟ ‣ Ϗδωεޭ͢Δ͔͔Βͳ͍ ϐϘοτ͢Δ͜ͱ͋Δ ૉૣ͘։ൃͯ͠ɺՁͷݕূΛߦ͍͍ͨ ͰɺϢʔβʔͷͱͯख़͍ͯ͠Δ ͡Ί͔Βҙਤ͢ΔػೳΛਖ਼͘͠ಈ࡞ͤ͞Δඞཁ͕͋Δ
ૉૣ͍։ൃWTਖ਼͘͠ಈ࡞͢ΔϓϩάϥϜ ΞʔΩςΫνϟʹΑͬͯடংΛखʹೖΕΑ͏ டংʹΑͬͯϢʔβʔͷՁఏڙΛखॿ͚͢Δ
டং͋Δ։ൃΛߦ͏ؒΛ୳͍ͯ͠·͢ ‣ $IBU8PSLͰ"OESPJEJ04ΤϯδχΞΛืूத ΞʔΩςΫνϟͱڞʹ͋Δ։ൃΛ͠·ͤΜ͔ʁ ౦ژΦϑΟεେࡕΦϑΟε ౦ژΦϑΟε݄ʹ౦ژλϫʔͦʹҠస͠·͢ ࠓઙ ͔ͬͺڮಓ۩֗ͷத
ʹ͋Γ·͢ IUUQDPSQDIBUXPSLDPNKBSFDSVJUFOHJOFFS
͓͠·͍