Slide 1

Slide 1 text

Mobile DevOps Summit 2022 Native development without double cost

Slide 2

Slide 2 text

About me 2 ‣Founder / CEO at Egeniq ‣ Solution architect ‣Media apps ‣Dutch COVID-19 apps ‣Organizer of Appdevcon

Slide 3

Slide 3 text

Native vs Cross Platform

Slide 4

Slide 4 text

Native vs Cross Platform - Benefits ‣Native benefits ‣How the platform vendors intended it ‣Direct integration of device features ‣An Android UI that Android users expect ‣An iOS UI that iOS users expect ‣Best performance ‣No leaky abstractions ‣Small binaries ‣Large development ecosystem ‣Long term support 4 ‣Cross platform benefits ‣One codebase to rule them all ‣Common abstraction of device features ‣The same UI on all platforms ‣(Unless you spend additional time) ‣Not limited to iOS/Android ‣e.g. Flutter on web

Slide 5

Slide 5 text

Native vs Cross Platform - Drawbacks ‣Native drawbacks ‣2 codebases to maintain ‣Needs separate testing for Android and iOS 5 ‣Cross-platform drawbacks ‣3 stacks to master ‣Needs separate testing for Android and iOS ‣The same UI on all platforms ‣Feels ‘off’ to experienced users ‣Performance ‣Lack of longevity ‣Cordova now considered ‘legacy’ ‣ReactNative losing ground to Flutter ‣Reduced older OS version support

Slide 6

Slide 6 text

Seeking best of both worlds Can we harness the benefits of native, while gaining some of the benefits that cross-platform offers? 6

Slide 7

Slide 7 text

What we want to avoid 7 iOS Android 1 1 + 2 Architecture Development Testing

Slide 8

Slide 8 text

Shared Architecture

Slide 9

Slide 9 text

Android and iOS development paradigms are converging 9 Java Objective-C Years ago….

Slide 10

Slide 10 text

Android and iOS development paradigms are converging 10 Java Objective-C Kotlin Swift Coroutines Async/await Compose SwiftUI MVVM

Slide 11

Slide 11 text

Shared Architecture Approach ‣Shared Architecture Approach: ‣An iOS and Android engineer cooperate on the technical design: ‣One datamodel for Android and iOS ‣One definition of business logic ‣One approach for backend integration 11

Slide 12

Slide 12 text

Shared Architecture Approach 12 Conceptual Data Model Model layer ViewModel layer View layer

Slide 13

Slide 13 text

Shared Architecture Approach 13 Conceptual iOS Android Data Model Model layer ViewModel layer View layer Compose Views SwiftUI Views ViewModel ViewModel Repositories / Models Repositories / Data Classes Core Data / SQLite Room / 
 SQLite

Slide 14

Slide 14 text

Impact on project 14 iOS Android 0.70 0.70 + 1.7 Architecture Development Testing Shared 0.30

Slide 15

Slide 15 text

Asynchronous Development

Slide 16

Slide 16 text

What is asynchronous development? 16 iOS Android Develo p feature A Develo p feature B

Slide 17

Slide 17 text

What is asynchronous development? 17 iOS Android Develo p feature A Develo p feature B Port feature A Port Feature B

Slide 18

Slide 18 text

Impact on project 18 iOS Android 0.65 0.65 + 1.5 Architecture Development Testing Shared 0.20 feature A feature B feature C feature D port A port B port C port D

Slide 19

Slide 19 text

Shared Core

Slide 20

Slide 20 text

Shared Core Approach 20 iOS Android Layouts / Views Xibs / ViewControllers ViewModel ViewModel Repositories / Data Classes Storage { } Swift Kotlin { Some shared language

Slide 21

Slide 21 text

Shared Core Approach 21 iOS Android Layouts / Views Xibs / ViewControllers ViewModel ViewModel Repositories / Data Classes Storage { } Swift Kotlin { Some shared language Device features Device features { Swift }Kotlin

Slide 22

Slide 22 text

Options for shared cores ‣Shared core could be written in: ‣Kotlin Multiplatform ‣C / C++ ‣Go ‣Rust ‣… 22

Slide 23

Slide 23 text

Shared Core - Kotlin Multiplatform 23 Kotlin Multiplatform: ‣No need to add a 3d stack ‣Development could be handled by the Android devs ‣Is specifically created for the ‘shared core’ use case

Slide 24

Slide 24 text

Shared Core - Others 24 C / C++ ‣ 3 stacks to master ‣ Relatively complex ‣ Very performant ‣ Small footprint ‣ Tough to find devs Go ‣ 3 stacks to master ‣ Bigger binaries ‣ Popular language ‣ Good performance ‣ Easy to learn Rust ‣ 3 stacks to master ‣ Good performance ‣ Suitable for backends too ‣ Tough to find devs

Slide 25

Slide 25 text

Impact on project 25 iOS Android 0.4 0.4 + 1.4 Architecture Development Testing Shared 0.6

Slide 26

Slide 26 text

Combine all the things!

Slide 27

Slide 27 text

Impact on project - all 3 optimisations combined 27 iOS Android 0.30 0.30 + 1.2 ? Architecture Development Testing Shared 0.60 feature A feature B feature C feature D port A port B port C port D

Slide 28

Slide 28 text

Learnings 1.2 is a bit ambitious ‣Methods aren’t fully complementary but overlap ‣If shared core pushes the native code mostly to the UI, then the porting effect of async development is damped a bit In our experience a 1.3-1.6 factor is definitely feasible! 28

Slide 29

Slide 29 text

Other Considerations

Slide 30

Slide 30 text

Other Considerations: a project is more than app development ‣Consider the total size of a project: ‣4 person project + separate iOS / Android devs = meh. ‣Additional cost factor of doing native (without the optimisations in this talk) = ~ 2 ‣60 person project + small number of programmers , doing +2 devs to be able to remain native = sure, why not. ‣Additional cost factor of doing native (again without optimisations) = ~ 1.03 30

Slide 31

Slide 31 text

Other Considerations: skills gap ‣The cost of native vs cross platform is also determined by: ‣Existing skills in team ‣E.g. a team coming from web development will be faster in React Native ‣Nature of the project ‣A throw-away… marketing… ui-only project will benefit more from cross platform ‣A strategic app with years of support will benefit more from native 31

Slide 32

Slide 32 text

The Future We do research into optimised native development: 32 We will continue to share our findings /learnings

Slide 33

Slide 33 text

Thank you! Questions? [email protected] Ivo Jansch @ijansch