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
「iOSエンジニアだし、Androidアプリも作れるでしょ?」
Search
akatsuki174
September 20, 2020
Programming
9
3.3k
「iOSエンジニアだし、Androidアプリも作れるでしょ?」
2020/09/20 iOSDC Japan 2020 day 1
akatsuki174
September 20, 2020
Tweet
Share
More Decks by akatsuki174
See All by akatsuki174
SwiftUI、UIKitでキャプチャを撮ろう!
akatsuki174
1
42
Appleにおけるプライバシーの全容を把握する
akatsuki174
0
5.4k
近年のAppleにおける位置情報とプライバシー
akatsuki174
3
400
オフライン勉強会ぼっち対策
akatsuki174
1
580
Xcode 15の新機能
akatsuki174
0
2.6k
AndroidにもSelect Photosがやってきた
akatsuki174
0
1.2k
Famm Android改善記
akatsuki174
0
340
Flutterアプリ開発にネイティブコードはどこまで求められるのか
akatsuki174
2
4.5k
UIKitのアップデート #WWDC22
akatsuki174
4
1.3k
Other Decks in Programming
See All in Programming
Stackless и stackful? Корутины и асинхронность в Go
lamodatech
0
700
StarlingMonkeyを触ってみた話 - 2024冬
syumai
3
270
CSC509 Lecture 14
javiergs
PRO
0
140
開発者とQAの越境で自動テストが増える開発プロセスを実現する
92thunder
1
180
Fibonacci Function Gallery - Part 1
philipschwarz
PRO
0
210
Scalaから始めるOpenFeature入門 / Scalaわいわい勉強会 #4
arthur1
1
300
ソフトウェアの振る舞いに着目し 複雑な要件の開発に立ち向かう
rickyban
0
890
あれやってみてー駆動から成長を加速させる / areyattemite-driven
nashiusagi
1
200
見えないメモリを観測する: PHP 8.4 `pg_result_memory_size()` とSQL結果のメモリ管理
kentaroutakeda
0
310
ドメインイベント増えすぎ問題
h0r15h0
1
230
Monixと常駐プログラムの勘どころ / Scalaわいわい勉強会 #4
stoneream
0
270
RWC 2024 DICOM & ISO/IEC 2022
m_seki
0
210
Featured
See All Featured
Designing for humans not robots
tammielis
250
25k
Navigating Team Friction
lara
183
15k
Six Lessons from altMBA
skipperchong
27
3.5k
4 Signs Your Business is Dying
shpigford
181
21k
Site-Speed That Sticks
csswizardry
2
190
Building Flexible Design Systems
yeseniaperezcruz
327
38k
A Philosophy of Restraint
colly
203
16k
A Tale of Four Properties
chriscoyier
157
23k
Scaling GitHub
holman
458
140k
Thoughts on Productivity
jonyablonski
67
4.4k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
169
50k
BBQ
matthewcrist
85
9.4k
Transcript
ʮiOSΤϯδχΞͩ͠ɺ AndroidΞϓϦ ࡞ΕΔͰ͠ΐʁʯ iOSDC Japan 2020 @akatsuki174
ࣗݾհ
• ਢ౻ຘʢ@akatsuki174ʣ • iOS→AndroidΤϯδχΞ • גࣜձࣾTimersॴଐ • ࠷ۙiOSࣄͰͬͯΔ • Αͬͯ͘ΔɺiPhone
Xͱ Pixel 3 • iOSDC Japan 2020 core staff
ࠓͷ
࣍ • iOS/AndroidͷUIͰҧ͏ͱ͜Ζ • Swiftͱൺֱͭͭ͠KotlinΛֶ΅͏ • ActivityɺFragmentΛཧղ͠Α͏ • Α͘͏ListViewͱRecyclerViewΛΖ͏ •
؆୯ͳUI͕ΊΔΑ͏ʹͳΖ͏ • ࠷ݶͷσόοά͕Ͱ͖ΔΑ͏ʹͳΖ͏
ͳΜͱͳ͘Ͱ͖ΔΑ͏ʹͳΔ͜ͱ • iOS/Androidͷҧ͍͕Θ͔Δ • Kotlinίʔυ͕ಡΊΔΑ͏ʹͳΔ • AndroidΞϓϦͷ࡞Γํ͕Θ͔Δ • ෆ۩߹ͷಛఆ͕Ͱ͖ΔΑ͏ʹͳΔ
ࠓͷࢿྉ
ࠓͷࢿྉ • SpeakerDeckʹ্͛ͯ·͢ • TwitterͰྲྀͯ͠·͢
iOS/AndroidͷUIͰ ҧ͏ͱ͜Ζ
ࣅͯΔ͚Ͳɺҧ͏ • iOS/AndroidͰࣅͯΔͷʹ͍ͭͯઆ໌ • ࣅͯͯࡉ෦͕ҟͳ͍ͬͯͨΓ͢ΔͷͰ҆қ ʹஔ͖͑ΒΕͳ͍͜ͱ
ը໘ભҠ • iOS • ϓογϡભҠ͕ج࣠ɻ֊Λ۷ΔΠϝʔδɻ • ঢ়گʹΑͬͯɺϞʔμϧભҠ • Android •
ϖʔδΛੵΈॏͶΔΠϝʔδɻ
ΔϘλϯͷ༗ແ • iOS • ΄΅ඞ͍͍ͣͭͯΔ • Android • ͍ͭͯͳ͍͜ͱ͋Δ •
ʹΔϘλϯ͕͋Δ
J04 "OESPJE
ը໘λΠτϧͷҐஔ • iOS • தԝ • ϥʔδλΠτϧͩͱࠨ • Android •
ࠨ
J04 "OESPJE
ཁૉબ • iOS • ϦετɺυϥϜϩʔϧɺΞΫγϣϯγʔτ • Android • νΣοΫϘοΫεɺϥδΦϘλϯɺυϩοϓ μϯϦετɺϘτϜγʔτ
J04 "OESPJE
Ϧετͷҹ • iOS • Disclosure IndicatorΛ͚ͨΓ͢Δ • Android • ͚ͳ͍ํ͕Ұൠతʁ
J04 "OESPJE
બ • iOS • υϥϜϩʔϧ • iOS 14͔ΒΧϨϯμʔܕ • Android
• ΧϨϯμʔܕ
"OESPJE J04
ϑϩʔςΟϯάΞΫγϣϯϘλϯ • ͦͷը໘ͷओΞΫγϣϯϘλϯ • iOSͰ͍ͬͯΔྫͪΒ΄Β
None
γϟυ • ϚςϦΞϧσβΠϯʹӨͷষ͕͋Δ • Z࣠ɺಈ͖ͷํΛ֮ͤ͞Δ • Өͷೱ͞ߴ͞ɺଞͱͷؔʹΑܾͬͯ·Δ
https://material.io/design/environment/light-shadows.html#shadows ᶃ ᶄ ᶅ
φϏήʔγϣϯυϩϫʔ • iOS • كʹͦΕͬΆ͍ͷ͕͋Δ • Android • ը໘ࠨ͔ΒεϥΠυͯ͠දࣔͰ͖Δϝχϡʔ
None
ࢀߟʹͳΔαΠτ • consim • iOS/Androidͷը໘ΛൺֱͰ͖ΔαΠτ • https://consim.design/ • ʮAndroidiOSͱಉ͡σβΠϯͰʂʯͱݴΘΕͨͱ͖ͷ ରԠҊ
• https://qiita.com/ogapants/items/ 8a551ed3b16bcf0cc3ed
Swiftͱൺֱͭͭ͠ KotlinΛֶ΅͏
Kotlinͱ • JetBrains͕։ൃͨ͠ΦϒδΣΫτࢦɹɹɹ ϓϩάϥϛϯάݴޠ • Google I/O 2017ͰAndroidνʔϜ͕KotlinΛ ެࣜʹαϙʔτ͢Δ͜ͱΛൃද •
Javaͷࢿ࢈ͷଟ͘Λྲྀ༻Ͱ͖Δ • 1ͭͷϓϩδΣΫτʹJavaͱKotlinͷࠞࡏՄ
KotlinͱSwift • ΘΓͱॻ͖ํ͕ࣅͯΔ • جຊจ๏Ͱࣅ͍ͯΔͷΛհ
ϓϩύςΟએݴ
Φϓγϣφϧ
Ξϯϥοϓ
ؔ
ྻૢ࡞
Ϋϥε֦ு
ΠϯλʔϑΣʔεɺϓϩτίϧ
ͦͷଞ
ActivityɺFragmentΛ ཧղ͠Α͏
ActivityͱFragment • MVCͰݴ͏ͱ͜ΖͷControllerΈ͍ͨͳͷ • ϥΠϑαΠΫϧΛ͍࣋ͬͯΔ
Activityͱ • ௨ৗɺ1ͭͷActivityͰ1ͭͷը໘Λ࣮͢Δ • ≒ UIViewController
https://developer.android.com/guide/components/ activities/activity-lifecycle?hl=ja
"DUJWJUZ ੜ࣌ "DUJWJUZ͔ΒΕΑ ͏ͱ͍ͯ͠ΔɻӬଓԽॲཧ ͜͜Ͱɻ Ϣʔβ͕ΠϯλϥΫ γϣϯΛ࣮ࢪͰ͖Δঢ়ଶ "DUJWJUZ͕ ݟ͑ͳ͘ͳͬͨͱ͖ https://developer.android.com/guide/components/
activities/activity-lifecycle?hl=ja
ActivityͷϨΠΞτ • Activity#onCreate(Bundle)ͷதͰ Activity#setContentView(int)Λݺͼग़͢ • intϨΠΞτϑΝΠϧͷid
Fragmentͱ • ActivityʹΈࠐΜͰ͏ • 1ͭͷActivityʹෳͷFragmentΛΈ߹Θͤɹ ΒΕΔ • ଟղ૾ରԠ࣌ʹศར • ෳͷActivityͰFragmentΛ࠶ར༻Ͱ͖Δ
https://developer.android.com/guide/ components/fragments?hl=ja#Creating
https://developer.android.com/guide/ components/fragments?hl=ja#Creating 'SBHNFOU͕ "DUJWJUZʹ Έࠐ·Εͨঢ়ଶ 'SBHNFOU ͕࣋ͭ 7JFXΛߏங 'SBHNFOU ͕"DUJWJUZ͔Β
Γ͞ΕΔ
https://developer.android.com/guide/components/fragments?hl=ja#Design
Α͘͏ListViewͱ RecyclerViewΛΖ͏
ListViewͱ • Androidͷॳظ͔Β༻ҙ͞Ε͍ͯΔΫϥε • γϯϓϧͳҰཡදࣔ
ొਓͷΠϝʔδ %BUB4PVSDF "EBQUFS -JTU7JFX $VSTPS "SSBZ-JTU FUD
ListViewʢ࣮ʣ
ListViewʢϨΠΞτʣ
RecyclerViewͱ • ListViewΛ֦ுͯ͠ॊೈੑΛͨͤͨվྑ൛ • εϫΠϓɺD&DͳͲΛ͢ΔͳΒͬͪ͜ • ϔομʔɺϑολʔͷΈଘࡏ͠ͳ͍ • ۠ΓઢࣗͰ࣮͢Δඞཁ͕͋Δ
ొਓͷΠϝʔδ %BUB4PVSDF "EBQUFS 7JFX)PMEFS 3FDZDMFS7JFX -BZPVU.BOBHFS
RecyclerViewʢຊମʣ
RecyclerViewʢAdapterʣ
RecyclerViewʢViewHolderʣ
RecyclerViewʢϨΠΞτʣ
RecyclerViewʢϨΠΞτʣ
؆୯ͳUI͕ ΊΔΑ͏ʹͳΖ͏
AndroidͷϨΠΞτͷ࡞Γํ • xmlͰهड़ɺ͘͠GUIͰ࡞ ʢStoryboard, xibΈ͍ͨͳ͔Μ͡ʣ • ͍ͣΕʹͯ͠xml͕ੜ͞ΕΔ
None
None
None
LayoutsͱWidgets • LayoutͰΛࢦఆ͠ɺ෦ͱͳΔWidgetΛɹ ฒ͍ͯ͘ • WidgetʹButton, ImageView, TextView, ListViewͳͲ͕͋Δ
-BZPVU 8JEHFU -BZPVU
͞·͟·ͳϓϩύςΟ • LayoutɺWidgetiOSͱಉ͡Α͏ʹɺ༷ʑͳɹ ઃఆΛՃ͑Δ͜ͱ͕Ͱ͖Δ • ͪΖΜLayout/WidgetʹΑͬͯઃఆͰ͖Δɹ ϓϩύςΟҟͳΔ • ͜͜ͰදతͳͷΛհ
id • ݴ༿௨Γɺࣝผࢠ • ಉҰϑΝΠϧͰҰҙͳ໊લʹͳ͍ͬͯΕɹ ྑ͍ • xmlͰৼͬͨidΛݩʹKotlinϑΝΠϧ͔Βݺͼɹ ग़͕͠Ͱ͖Δ
None
None
width/height • ݴ༿௨Γɺ෯ͱߴ͞ • `match_parent`ͩͱͷViewʹର͍ͯͬ͠ͺ͍ ʹ͕Δ • `wrap_content`༰ʹ߹Θͤͯௐઅ͞ΕΔ • ͪΖΜઈରࢦఆՄ
None
ओͳLayoutͷछྨ • LinearLayout • ॎorԣ1ྻʹཁૉΛฒΔ • UIStackViewͬΆ͍͔Μ͡ • ConstraintLayout •
ཁૉʹ੍Λ͚ɺҐஔΛ૬ରతʹܾΊΔ
None
None
None
None
None
͓·͚ɿϓϨϏϡʔTips
༨ஊɿJetpack Compose • Google I/O 2019Ͱൃද͞ΕͨɺUIπʔϧΩοτ • SwiftUIͷΑ͏ʹɺએݴతʹUIΛߏஙͰ͖Δ
https://developer.android.com/jetpack/compose?hl=ja
࠷ݶͷσόοά͕ Ͱ͖ΔΑ͏ʹͳΖ͏
2௨Γհ • ϒϨʔΫϙΠϯτΛுΔํ๏ • Ϗϡʔ֊ΛѲ͢Δํ๏
ϒϨʔΫϙΠϯτͷுΓํ
None
None
None
͜Μͳέʔε͋Γ·ͤΜ͔ʁ • RecyclerViewͷpositionͳͲɺมΘΓΏ͘Λ Ѳ͍ͨ͠ • ͍͍ͪͪϒϨʔΫϙΠϯτͰࢭ·ͬͯ΄͘͠ɹ ͳ͍ • ίʔυʹLog.dॻ͍ͯ࠶Ϗϧυ͢Δͷ໘
ղܾͰ͖·͢ • Evaluate and logΛ׆༻͢Ε࠶Ϗϧυͤͣɹ ϩάΛग़ྗͰ͖Δ • ίʔυ͍͡Δඞཁ͕ͳ͍
None
None
None
Ϗϡʔ֊ͷݟํ • Layout InspectorΛ͏
None
·ͱΊ
·ͱΊ • iOSͷੈքΛ͍ͬͯΕAndroidͦ͜·Ͱɹ ͘͠ͳ͍ʂʂʂ
એ
• αʔόʔαΠυΤϯδχΞ (PHP, Golang, AWS) • AndroidΤϯδχΞ (Kotlin) • iOSΤϯδχΞ
(Swift) TimersͰݱࡏΤϯδχΞશ৬छ࠾༻தʂ ৄ͘͠”Timers”Ͱݕࡧ
͝ਗ਼ௌ ͋Γ͕ͱ͏͍͟͝·ͨ͠ʂ