クロスプラットフォームモバイルアプリ開発ツール総ざらい2019 〜Titanium Mobile から Kotlin/Native まで〜 #droidkaigi
by
amay077
Link
Embed
Share
Beginning
This slide
Copy link URL
Copy link URL
Copy iframe embed code
Copy iframe embed code
Copy javascript embed code
Copy javascript embed code
Share
Tweet
Share
Tweet
Slide 1
Slide 1 text
ΫϩεϓϥοτϑΥʔϜ ϞόΠϧΞϓϦ։ൃπʔϧ ૯͟Β͍2019 2019.2.7 DroidKaigi2019 @amay077 ʙTitanium Mobile͔ΒKotlin/Native·Ͱʙ
Slide 2
Slide 2 text
About me • Ԟࢁ ༟ਈ - @amay077ʢ͋Ί͍ʣ • Android, iOS, Xamarin, TypeScript AWS, Azure… • ѪݝࡏॅͷϑϧϦϞʔτϫʔΧʔ • ཧใγεςϜɺҐஔใϓϩάϥϛϯά • DroidKaigi2017ొஃˠٕज़ॻయ2→ۀຊԽ(ڞஶ)
Slide 3
Slide 3 text
Work for • B2B͚PaaSɺݿཧɾӡૹۀ͚SaaS • AWS, Elasticsearch, Cassandra, Lambda, etc • શһ͕ϑϧϦϞʔτϫʔΧʔ ͓ࣄ༰ϦϞʔτͰͷಇ͖ํͳͲڵຯ͋Δํɺؾܰʹฉ͍͍ͯͩ͘͞
Slide 4
Slide 4 text
ࠓ͓ͳ͢͠Δ͜ͱ Android ͱ iOS ͚ͷʮωΠςΟϒΞϓϦʯ͕ ։ൃͰ͖Δπʔϧʹ͍ͭͯ ΨϫωΠςΟϒWebΞϓϦͱͷൺֱ ࠓ͓ͳ͠͠ͳ͍ࣄ ϕετϓϥΫςΟε ήʔϜܥ ੩తϥΠϒϥϦ(.a) ΒΜ
Slide 5
Slide 5 text
༻ޠॖ͠·͢ ΫϩεϓϥοτϑΥʔϜˠ X-Plat ϓϥοτϑΥʔϜ → PF R/N → React Native K/N → Kotlin Native Multi Platform Project → MPP
Slide 6
Slide 6 text
Agenda 1. ͳͥX-Plat։ൃπʔϧΛ͏ͷ͔ʁ 2. X-Plat։ൃπʔϧྲྀߦͷྺ࢙ 3. X-Plat։ൃπʔϧͷྨ 4. Kotlin/NativeͷՄೳੑ 5. VS WebΞϓϦ
Slide 7
Slide 7 text
ͳͥ X-Plat։ൃπʔϧΛ͏ͷ͔ʁ
Slide 8
Slide 8 text
A:ʮແݶͷϚχʔ͕ͳ͍͔ΒͰ͢ʯ
Slide 9
Slide 9 text
X-Plat։ൃπʔϧ ʮඞཁѱʯ Ͱ͢
Slide 10
Slide 10 text
ͳͥX-Plat։ൃπʔϧΛ͏ͷ͔ʁ ʢۀγεςϜ։ൃऀͷཱ͔Βʣ 1. ࣾһ20ਓதɺϞόΠϧ୲͕1ʙ2ਓ͔͠ډͳ͍ 2. Ϧʔυސ٬ͷཁٻʹԠͯ͡ɺਝʹϓϩτλΠϓ Λ࡞Δඞཁ͕͋Δ(Android? iOS? ͍྆ํ) 3. Android൛Λೲͨ͠ޙͰɺiOS൛ͷ։ൃґཔ͕ དྷΔˠͦͷޙͷอकΛ̍ਓͰΔ͜ͱʹ
Slide 11
Slide 11 text
ͳͥX-Plat։ൃπʔϧΛ͏ͷ͔ʁ ʢݸਓϓϩάϥϚͷཱ͔Βʣ 1. झຯͰAndroidΞϓϦΛ3ϲ݄͘Β͍͔͚ͯ࡞ͬͨ 2. ετΞʹϦϦʔεͨ͠ΒׂͱߴධՁͩͬͨ 3. iOS൛ཉ͍͠ͱݴΘΕͨ 4. ͍͟ iOS൛ ։ൃʹணख͕ͨ͠ɺ·ͨ3ϲ݄͔͚ͯ ಉ͜͡ͱΛΔͷ͔ʔʢઓҙࣦ
Slide 12
Slide 12 text
X-Plat։ൃπʔϧ͚ͩͲX-Plat͡Όͳ͍ ޮΑ͘։ൃͰ͖ΔϛυϧΣΞͱͯ͠ͷX-Plat։ൃπʔϧ AndroidϚϯ͚ͩͲReactNativeͰiOS൛Ͱ͖·ͨ͠ iOSΨʔϧ͚ͩͲFlutterͰAndroid൛Ͱ͖·ͨ͠ AndroidϚϯ͚ͩͲXamarin.FormsͰAndroid൛͚ͩ࡞Γ ·ͨ͠ →⭕ʮ͓·͡ͳ͍ʯʮ͓࡞๏ʯ͕ڞ௨APIʹ࣮ࡁΈ
Slide 13
Slide 13 text
X-Plat։ൃπʔϧ ྲྀߦͷྺ࢙ ⏰45
Slide 14
Slide 14 text
Titanium Mobile by Appcelerator • ྲྀߦ: 2011ʙ ※Զ؍ଌʹΑΔ • JavaScript Ͱ iOS ͱ Android ΞϓϦ͕࡞ΕΔͱ͍͏৮ΕࠐΈ • ݩτϨλͷ @masuidrive ͞Μ͕ΤϰΝϯδΣϦετͯͨ͠ • Zaim ͷॳظόʔδϣϯίϨͩͬͨ • ࢲධ:ʮiOSͰ͔͠ಈ͔ͳ͍APIଟ͗͢ϫϩλʯ
Slide 15
Slide 15 text
AIR for Mobile by Adobe • ྲྀߦ(ͯ͠ͳ͍Ͷ): 2012ʙ • ActionScript ͰҎԼಉจ • Adobe FlashܥͳͷͰʮUIಠࣗඳըํࣜʯΛ࠾༻ • Α͘ѱ͘ʮFlashͬΆ͍ʯΞϓϦʹͳͬͨ • ࢲධ:ʮͬ͞Γ͕ͯ͠Δ…த՚ϑΥϯτ…ʯ
Slide 16
Slide 16 text
RubyMotion by Scratchwork • ྲྀߦ: 2013ʙ • Ruby Ͱ iOS ͱ Android(ޙൃ) ΞϓϦ͕࡞ΕΔͱ͍͏৮ΕࠐΈ • iOS·ͨAndroidͷAPI͕Ruby͔Βݺͼग़ͤΔͱ͍͏ PFͷAPIϥούΛఏڙ • ݩͯͳCTOͷਓ͕ rebuild.fmͰڭ? • ࢲධ:ʮWebܥRubyistʹͬͱΘΕΔ͔ͱࢥ͚ͬͨͲͶ…ʯ
Slide 17
Slide 17 text
Delphi/C++Builder by Embarcadero • 2013ʙ • Delphi/C++ Ͱ iOSͱAndroidɺWin/Mac͚ΞϓϦ͕։ൃՄ • Adobe Airͱಉ͘͡ʮUIಠࣗඳըํࣜʯΛ࠾༻ • ͭɺiOS·ͨAndroidͷAPIͷAPIϥούʔఏڙ • ࢲධ:ϚχΞ͕બͿʰͬͱධՁ͞ΕͯΑ͍։ൃπʔϧNo.1ʱ
Slide 18
Slide 18 text
Xamarin by Mircosoft • ྲྀߦ: 2016ʙ • C#/.NET Ͱ iOS ͱ AndroidɺWin͚ΞϓϦ͕։ൃՄ • Android/iOS APIͷϥούʔʹՃ͑ɺ .NET FrameworkͷҰ෦ػೳΛڞ௨APIͱͯ͠ఏڙ • ը໘։ൃʹɺڞ௨API(Xamarin.Forms)Λఏڙ • ࢲධ:ʮ࠷ۙฉ͔ͳ͍ʁ.NETͷҰ෦ͱͯ͠ਁಁ͠·ͨ͠ɻʯ
Slide 19
Slide 19 text
ReactNative by Facebook • ྲྀߦ: 2016ʙ • React Ͱ iOS ͱ AndroidɺWeb͚ΞϓϦ͕։ൃՄ • ڞ௨APIͱڞ௨ͷը໘ఆٛ(JSX)Λఏڙ • AirBnB͕Ϧʔυͨ͠ྲྀߦظͱݬ໓ظΛܦͯ҆ఆظʹʁ • Skype ReactNative(ReactXP)
Slide 20
Slide 20 text
Flutter by Google • ྲྀߦ: 2017ʙ • Dart Ͱ iOS ͱ Android͚ΞϓϦ͕։ൃՄ(Web͜Ε͔Β) • ಠࣗඳըํࣜʹΑΓAndroidͰiOSͰMaterialͳUIΛఏڙ (iOS-style ͋Γ) • HotReloadʹΑΔരը໘։ൃ͕ߴධՁ • ौ୩ͷJKͷ60%͕ʮDartͰͳ͚Ε…ʯͱճ
Slide 21
Slide 21 text
Kotlin/Native with MPP by JetBrains • ྲྀߦ: 2018?ʙ • Kotlin/Native • Kotlin ͔Β iOS(ͷଞPF)ͷ API ͕͑Δ • iOS/Android/Web͚ ωΠςΟϒ ϥΠϒϥϦ͕ϏϧυͰ͖Δ • MPP(Multi Platform Project) • ڞ௨APIΛ࡞ΔΈ(expect:ڞ௨API, actual:PFຖͷ࣮)
Slide 22
Slide 22 text
X-Plat։ൃπʔϧ ͷྨ ⏰45
Slide 23
Slide 23 text
ը໘ඳըํࣜʹΑΔྨ 1. PFʹҕৡ ϓϥοτϑΥʔϜͷUIύʔπ͕༻͞ΕΔ ʢAndroid:TextView, iOS:UILabel ʣ 2. ಠࣗඳը UIύʔπΛCanvasʹࣗྗͰඳը
Slide 24
Slide 24 text
PFʹҕৡํࣜͷಛ ⭕ωΠςΟϒͰ࡞ͬͨUIͱશʹಉ͡UXͰ͋Δ ⭕PF͚ͷOSSΛར༻͍͢͠ ❌ରԠPF͕૿͑Δͱɺͦͷ࣮͕ඞཁ ❌PFຖʹػೳ͕ҟͳΔͱڞ௨Խ͕ͮ͠Β͍ ྫ:iOSͷTextFieldʹauto-size͕͋Δ͚Ͳ…
Slide 25
Slide 25 text
ಠࣗඳըํࣜͷಛ ⭕εΩϯΛม͑Δ͚ͩͰPFͬΆ͍ݟͨʹͳΔ ⭕1ͭͷ࣮ͰଞPFʹରԠՄೳ ❌PF͚ͷOSSϥΠϒϥϦΛར༻ͮ͠Β͍ WebView, MapͳͲͳͲ ❌CJK(ςΩετඳըɾೖྗ)पΓͰτϥϒϧى͖͕ͪ
Slide 26
Slide 26 text
APIఏڙํࣜʹΑΔྨ 1. PFͷAPIϥούΛఏڙ͠ͳ͍ 2. PFͷAPIϥούΛఏڙ͢Δ Ruby͔ΒActivityΫϥε͕͑Δ ,PUMJO͔ΒUIViewController͕͑Δ
Slide 27
Slide 27 text
X-Plat։ൃπʔϧͰͷ࣮ͷجຊ 1. X-Plat։ൃπʔϧͷݴޠͷඪ४API,ΫϥεΛ͏ 2. X-Plat։ൃπʔϧ༻ͷڞ௨APIΛ͏ Core “Flutter” primitives ͳͲ 3. 1 2 ʹతͷAPI͕ͳ͚Εڞ௨APIΛࣗ࡞͢Δ 1→2→3ͷॱʹ࠶ར༻ੑམ͍ͪͯ͘ͷͰɺͳΔ͘1ͰؤுΔ ͕࣮ࡍͱͯ͠ 3. ඞਢͳͷͰڞ௨APIͷࣗ࡞ͷ͕͢͠͞ॏཁ
Slide 28
Slide 28 text
ڞ௨APIͷجຊతͳߟ͑ํ $BNFSB UBLF1IPUP *NH ڞ௨APIఆٛ(expected:࣮ແ͠) *OUFOUΛ͛ͯ ΧϝϥΛىಈʜ actual:Android͚ͷ࣮ 6**NBHF1JDLFS$POU SPMMFSͰ࣮ʜ actual:iOS͚ͷ࣮ ࣮͕ೖ͞ΕΔ ΞϓϦ ※ͬͱϩʔϨϕϧͳจࣈྻʹΑΔ Invoke Λ࠾༻͢ΔX-Plat͋Γ
Slide 29
Slide 29 text
ڞ௨APIͷجຊతͳߟ͑ํ $BNFSB UBLF1IPUP *NH ڞ௨APIఆٛ(expected:࣮ແ͠) *OUFOUΛ͛ͯ ΧϝϥΛىಈʜ actual:Android͚ͷ࣮ 6**NBHF1JDLFS$POU SPMMFSͰ࣮ʜ actual:iOS͚ͷ࣮ ࣮͕ೖ͞ΕΔ ΞϓϦ ͜͜ΛԿݴޠͰ ॻ͘ͷ͔ʁ
Slide 30
Slide 30 text
ReactNative ͷ߹ $BNFSB UBLF1IPUP *NH ڞ௨APIఆٛ(expected:࣮ແ͠) *OUFOUΛ͛ͯ ΧϝϥΛىಈʜ actual:Android͚ͷ࣮ 6**NBHF1JDLFS$POU SPMMFSͰ࣮ʜ actual:iOS͚ͷ࣮ ࣮͕ೖ͞ΕΔ ΞϓϦ +BWB4DSJQU ,PUMJO 4XJGU ڮ͠ͷઃఆ +BWB4DSJQU
Slide 31
Slide 31 text
Xamarinͷ߹ $BNFSB UBLF1IPUP *NH ڞ௨APIఆٛ(expected:࣮ແ͠) *OUFOUΛ͛ͯ ΧϝϥΛىಈʜ actual:Android͚ͷ࣮ 6**NBHF1JDLFS$POU SPMMFSͰ࣮ʜ actual:iOS͚ͷ࣮ ࣮͕ೖ͞ΕΔ ΞϓϦ $ $ $ $
Slide 32
Slide 32 text
Kotlin/Native with MPPͷ߹ $BNFSB UBLF1IPUP *NH ڞ௨APIఆٛ(expected:࣮ແ͠) *OUFOUΛ͛ͯ ΧϝϥΛىಈʜ actual:Android͚ͷ࣮ 6**NBHF1JDLFS$POU SPMMFSͰ࣮ʜ actual:iOS͚ͷ࣮ ࣮͕ೖ͞ΕΔ ΞϓϦ ,PUMJO ,PUMJO ,PUMJO
Slide 33
Slide 33 text
PFͷAPIϥούͷଘࡏ $BNFSB UBLF1IPUP *NH ڞ௨APIఆٛ(expected:࣮ແ͠) *OUFOUΛ͛ͯ ΧϝϥΛىಈʜ 6**NBHF1JDLFS$POU SPMMFSͰ࣮ʜ ࣮͕ೖ͞ΕΔ ΞϓϦ $ $ $༻ϥού $༻ϥού $ "OESPJE4%, J044%,
Slide 34
Slide 34 text
ڞ௨APIͷࣗ࡞ͷ͢͠͞ ʙPFͷAPIͷϥούʔ͕ͳ͍߹ʙ 1'ݻ༗"1*Λ͏ʹ,PUMJO4XJGUͰϥΠϒϥϦ Λ࣮͠ɺ91MBUଆͱڮ͢͠Δ͔͠ͳ͍ FlutterͷPlatformChannel, R/NͷNative Modules ͳͲ ❌ʮڮ͠ʯͰτϥϒϧى͖͕ͪ ❌ϥΠϒϥϦͱΞϓϦͰϓϩδΣΫτ͕அ͞ΕΔ σόοάͮ͠Β͍
Slide 35
Slide 35 text
ڞ௨APIͷࣗ࡞ͷ͢͠͞ ʙPFͷAPIͷϥούʔ͕͋Δ߹ʙ ⭕KotlinSwiftΛΘͳͯ͘PFͷAPIΛར༻Ͱ͖Δ ⭕ΞϓϦͱಉ͡ϓϩδΣΫτͱͯ͠σόοάͰ͖Δ ❌PF͚ͷϥΠϒϥϦΛ͏ʹʮڮ͠ʯ͢Δ͠ ͔ͳ͍ ❌APIʹஶ࡞ݖ͕͋ΔΜͰ͚ͨͬ͠
Slide 36
Slide 36 text
ը໘ඳըํࣜͱAPIఏڙํࣜʹΑΔྨ ↑PFʹҕৡ ↓ಠࣗඳը ←PFͷAPIϥού༗ PFͷAPIϥούແˠ Titanium Mobile Air for Mobile RubyMotion※ Delphi Flutter Xamarin Kotlin/Native※ React Native ※ը໘ఆٛΛڞ௨Խ͢Δػೳͳ͍
Slide 37
Slide 37 text
Kotlin/Native ͷՄೳੑ
Slide 38
Slide 38 text
Xamarin(.NET) vs Kotlin/Native(+MPP) ྫ: C#͔ΒActivityΫϥε͕͑ΔɺRuby͔Β UIViewController͕͑Δ ⭕KotlinSwiftΛΘͳͯ͘PFͷAPIΛར༻Ͱ͖Δ ⭕ΞϓϦͱಉ͡ϓϩδΣΫτͱͯ͠σόοάͰ͖Δ ❌PF͚ͷϥΠϒϥϦΛ͏ʹʮڮ͠ʯ͢Δ͔͠ͳ͍ ❌APIʹஶ࡞ݖ͕͋ΔΜͰ͚ͨͬ͠ 9BNBSJO ,PUMJO 1'ͷ"1*ϥού ͋Γ ͋Γ ඪ४"1*ɺ Ϋϥεͷ ๛ গͳΊ ରԠ1' αʔόʔαΠυɺ σεΫτοϓ αʔόʔαΠυɺ 8FC ଞݴޠ͔Βͷར༻ ෆՄೳ Մೳ
Slide 39
Slide 39 text
Kotlin/Native ͕ීٴ͢Δʹ MPPରԠOSS์͓͍ͬͯͯ૿͍͑ͯͩ͘Ζ͏ Ͱඪ४API͕ͬͱ֦ॆ͞Εͯ΄͍͠ ܕ͢Β OSS(klock) ʹཔΔΜ͡Ό… ϞόΠϧ͚ͷڞ௨APIηοτ(Xamarin.EssentialsͷΑ͏ͳ)ཉ͍͠ ྫ: val photo = camera.takePhoto() ͷ1ߦͰ Android/iOSͲͪΒ ࣸਅࡱӨͰ͖Δతͳ Ͳ͔͜ʹങऩ͞Εͳ͍͜ͱΛفΔ
Slide 40
Slide 40 text
VS WebΞϓϦ ʙ࠶ߟʂΨϫωΠςΟϒʙ
Slide 41
Slide 41 text
ΨϫωΠςΟϒΞϓϦͱ ωΠςΟϒΞϓϦ͕ͩɺը໘ʹWebView͔͠ͳ͘ɺͬͺ Βͦͷதʹදࣔͨ͠WebαΠτΛΞϓϦͱͯ͠ݟ͍ͤͯΔ͚ͩ (ʹΨϫ͚ͩωΠςΟϒ)ͳΞϓϦ UIUX͕ωΠςΟϒͱ͔͚Ε͍ͯΔɺಡΈࠐΈ͕සൃ͠ετ ϨεϑϧɺͳͲͷཧ༝ͰسΈݏΘΕ͖ͯͨ ͕ɺPWAͷྗ͕֦େ͢Δͳ͔Ͱݟ͠ඞࢸʢݸਓͷݟղʣ
Slide 42
Slide 42 text
࠶ߟʂΨϫωΠςΟϒ Α͘Ͱ͖ͨPWAωΠςΟϒΞϓϦʹ͍ۙUXΛఏڙ͢Δ (Twitter, Facebook, GoogleMapsͳͲ) ΨϫωΠςΟϒͷதʹʮΑ͘Ͱ͖ͨPWAʯ͕ຒΊࠐ·Ε͍ͯͨ ΒɺͦΕωΠςΟϒΞϓϦͱൺͯḮ৭ͳ͍ ʮͦΕPWAͰΑ͘ͳ͍ʁʯˠʮηϯαʔ͏ʁͳΒΨϫωΠςΟ ϒͰʯˠʮΞϓϦʹձࣾੜ໋ݒ͚ΔʁͳΒωΠςΟϒͰ͢Ͷʯ ͑ͬͱɺ͡Ό͋ Cordova, Monaca ͳͲͷग़൪Ͱ͔͢ʁ
Slide 43
Slide 43 text
ΨϫωΠςΟϒͷΨϫͰ͏X-Plat։ൃπʔϧ ͬͺΓ੩తܕ͚ݴޠΛ͍͍ͨ Ώ͘Ώ͘ʮશωΠςΟϒʯʹҠߦ͢Δ͔ PFͷAPIϥού͕͋ΔX-PlatͳΒPFݻ༗ػೳͷ ΞΫηεΑΓ؆୯ WebViewJavaScriptͱͷ࿈ܞඞਢ
Slide 44
Slide 44 text
ࣄྫ1:Nintendo Switch Online ΞϓϦ Xamarin.FormsʹΑΔΨϫωΠςΟ ϒΞϓϦ ίϯςϯπWebΞϓϦ(ͯͳ) ௨ɺϘΠενϟοτ(WebRTC)ͳ ͲωΠςΟϒ࣮
Slide 45
Slide 45 text
αϯϓϧ2:ݕࡧγεςϜ(ฐࣾࣄྫ) ͱ͋ΔCRMͷWebϖʔδ WebView “Ψϫ”Xamarin.Forms Χϝϥىಈ ίʔυ: BIJ002A 1. JavaScript→C#࿈ܞ 2. ڞ௨APIͰΧϝϥىಈɺΛࡱӨ 3. PFͷAPIϥούΛ͍ɺ Android:Tensorflow iOS:CoreML Ͱը૾͔ΒΛݕग़ 4. ίʔυΛC#→JavaScript࿈ܞͰ Webϖʔδʹฦ٫ ݕࡧ
Slide 46
Slide 46 text
·ͱΊ
Slide 47
Slide 47 text
·ͱΊ X-Plat։ൃπʔϧඞཁѱ ͲͷπʔϧΦϫίϯͰͳ͍ K/NʹݴޠͷนΛ͑ΒΕΔັྗ͕͋Δ PFͱͦͷݴޠͷϦεϖΫτΛΕͣʹ WebΞϓϦͱྑ͍ͬͯ͘͜͏
Slide 48
Slide 48 text
͝ਗ਼ௌ ͋Γ͕ͱ͏͍͟͝·ͨ͠$