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
34
Appleにおけるプライバシーの全容を把握する
akatsuki174
0
5.4k
近年のAppleにおける位置情報とプライバシー
akatsuki174
3
390
オフライン勉強会ぼっち対策
akatsuki174
1
570
Xcode 15の新機能
akatsuki174
0
2.5k
AndroidにもSelect Photosがやってきた
akatsuki174
0
1.2k
Famm Android改善記
akatsuki174
0
340
Flutterアプリ開発にネイティブコードはどこまで求められるのか
akatsuki174
2
4.4k
UIKitのアップデート #WWDC22
akatsuki174
4
1.2k
Other Decks in Programming
See All in Programming
Jakarta EE meets AI
ivargrimstad
0
590
聞き手から登壇者へ: RubyKaigi2024 LTでの初挑戦が 教えてくれた、可能性の星
mikik0
1
130
Realtime API 入門
riofujimon
0
150
OSSで起業してもうすぐ10年 / Open Source Conference 2024 Shimane
furukawayasuto
0
110
タクシーアプリ『GO』のリアルタイムデータ分析基盤における機械学習サービスの活用
mot_techtalk
4
1.4k
レガシーシステムにどう立ち向かうか 複雑さと理想と現実/vs-legacy
suzukihoge
14
2.2k
OnlineTestConf: Test Automation Friend or Foe
maaretp
0
110
A Journey of Contribution and Collaboration in Open Source
ivargrimstad
0
960
CSC509 Lecture 12
javiergs
PRO
0
160
Jakarta EE meets AI
ivargrimstad
0
650
型付き API リクエストを実現するいくつかの手法とその選択 / Typed API Request
euxn23
8
2.2k
2024/11/8 関西Kaggler会 2024 #3 / Kaggle Kernel で Gemma 2 × vLLM を動かす。
kohecchi
5
930
Featured
See All Featured
Raft: Consensus for Rubyists
vanstee
136
6.6k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
226
22k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
665
120k
Mobile First: as difficult as doing things right
swwweet
222
8.9k
Scaling GitHub
holman
458
140k
Learning to Love Humans: Emotional Interface Design
aarron
273
40k
10 Git Anti Patterns You Should be Aware of
lemiorhan
655
59k
How To Stay Up To Date on Web Technology
chriscoyier
788
250k
Done Done
chrislema
181
16k
Bootstrapping a Software Product
garrettdimon
PRO
305
110k
How to Ace a Technical Interview
jacobian
276
23k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
33
1.9k
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”Ͱݕࡧ
͝ਗ਼ௌ ͋Γ͕ͱ͏͍͟͝·ͨ͠ʂ