Slide 1

Slide 1 text

Building next generation apps - all-in one Accelerate your key learnings of modern Android app development with KMP Adit Lal GDE Android

Slide 2

Slide 2 text

Android GDE 🛠 Architect | Entrepreneur 🔊 Speaker 🌎 Globe Tro tt er 🍻 Beer enthusiast 🎯https:/ /androiddev.social/@aditlal 🔗aditlal.dev Adit GDE

Slide 3

Slide 3 text

Some early App development advice. Feature, Tech debt, and tips. How will Jetpack compose be a strong investment. Should you think in Kotlin Multiplatform. Our Talking points …

Slide 4

Slide 4 text

• Set clear goals for your Android app • De fi ne your target audience • Monetization & ROI Thoughts on App development

Slide 5

Slide 5 text

• Find out users' preferences and aversions. • Invest on a well thought process. • Focus on micro transactions - the core UX that gets your user to keep returning back to the app. Thoughts on Process

Slide 6

Slide 6 text

app core feature 2 feature 1 Monolith Expensive Object

Slide 7

Slide 7 text

What could possibly go wrong?

Slide 8

Slide 8 text

app core Feature B Feature A Feature modules Expensive Object

Slide 9

Slide 9 text

• Organise and decouple independent pieces of functionality • Improve project build times • De fi ne clear ownership boundaries between di ff erent teams Thoughts on modularisation

Slide 10

Slide 10 text

Feature module : • Owned by single team ? Set of team members • Encapsulates single feature • Single entry point • Smaller is better • Cannot depend on other feature modules • Every feature has an implementation and a contract module Thoughts on modularisation

Slide 11

Slide 11 text

App module : • No feature-speci fi c code • No infrastructure-speci fi c code. • Creates the DI tree structure and init it Thoughts on modularisation

Slide 12

Slide 12 text

Ownership? core auth common Feature n-1 Feature n+2 Feature n-2 Feature z Feature n Feature n+1 app … … … … …

Slide 13

Slide 13 text

Ownership? core auth common Feature n-1 Feature n+2 Feature n-2 Feature z Feature n Feature n+1 app … … … … …

Slide 14

Slide 14 text

No content

Slide 15

Slide 15 text

Inversion of control Dependency Inversion Dependency Injection IoC Principle

Slide 16

Slide 16 text

• Declare Components that can be reused. • High level modules should not depend on low level modules • Build abstractions so any implementation can be easily changed with new one. • Dependencies can be injected into components. IoC Principle

Slide 17

Slide 17 text

Feature development

Slide 18

Slide 18 text

Serve webp images Make design easier to use. Think it through, vet libraries, and keep pe rf ormance in mind. Prioritise bandwidth of user network. O ff l ine fi rst is really powe rf ul UX experience.

Slide 19

Slide 19 text

19 Build Speed Big Tech debt a ff ecting almost everyone

Slide 20

Slide 20 text

20 Tech Debt Solve this at the most convenient time possible and o ft en. Don’t stack, solve it.

Slide 21

Slide 21 text

21 Reduce background tasks when the device is running on ba tt ery power. Avoid wake-locks Batch calls - Work manager to rescue Don’t be greedy with GPS usage be proactive Minimize the sensors to when most needed Ba tt ery Historian - a great tool to benchmark app for ba tt ery usage Consider your footprint

Slide 22

Slide 22 text

22 Jetpack compose

Slide 23

Slide 23 text

23 Jetpack compose UI Toolkit is independent to the OS 🪄 State Management is built in🥳 Lots of context switching 🎉 So rt ed code logic 🚀

Slide 24

Slide 24 text

Android GDE 🛠 Architect | Entrepreneur 🔊 Speaer 🌎 Globe Tro tt

Slide 25

Slide 25 text

a wild idea to build apps pops! develop for Android and iOS

Slide 26

Slide 26 text

‣ hire a team - Android and iOS ‣ de fi ne requirements ‣ plan roadmap for development ‣ develop and maintain and test apps ‣ production validation ‣ cross-check parity among both pla tf orms

Slide 27

Slide 27 text

native ~2x the team the cost time spent in meetings time spent on development time spent on testing time spent on bug fi xing

Slide 28

Slide 28 text

No content

Slide 29

Slide 29 text

how do we have the best of both worlds?

Slide 30

Slide 30 text

a wild idea to build apps pops! and web develop for Android and iOS

Slide 31

Slide 31 text

native + web ~3x the team the cost time spent in meetings time spent on development time spent on testing time spent on bug fi xing

Slide 32

Slide 32 text

No content

Slide 33

Slide 33 text

No content

Slide 34

Slide 34 text

let’s fi nd a solution that works on all pla tf orms.

Slide 35

Slide 35 text

let’s fi nd a solution that works on all pla tf orms.

Slide 36

Slide 36 text

2006 2008 2011 2012 2013 2015 2017 2018 . . . . . . .

Slide 37

Slide 37 text

Cross-pla tf orm advantages

Slide 38

Slide 38 text

Cross-pla tf orm advantages • smaller team/s • typically half of the cost needed on native • small learning curve for web developers

Slide 39

Slide 39 text

Cross-pla tf orm advantages dis • Locked to the framework implementation of UI - new updates from the OS will take time to adapt • pe rf ormance is not on par to native • One may end up also writing native code alongside • OS / device features are dependent on the fw suppo r

Slide 40

Slide 40 text

how do we have the best of both worlds?

Slide 41

Slide 41 text

how do we have the best of both worlds?

Slide 42

Slide 42 text

Kotlin • developed by JetBrains • open source • concise, safe, interoperable, dev tool-friendly • Suppo rt ed/used by Google for Android Development • It is so much more than “just for Android”

Slide 43

Slide 43 text

Kotlin K otlin multipla tf orm Using kotlin in projects to target more than one pla tf orm

Slide 44

Slide 44 text

Kotlin multipla tf orm “Shared UI is a history of pain and failure. Shared logic is the history of computers.” - Kevin Galligan

Slide 45

Slide 45 text

Kotlin multipla tf orm - language features - kotlin fi rst! - low risk - you decide what’s wo rt h to share across projects - interoperability - consistency across pla tf orms - strong community suppo rt

Slide 46

Slide 46 text

Kotlin multipla tf orm /kot · lin mul · ti · plat · form / / kät' lin malti' platfôrm, kät'lin melti'platfôrm/ noun optional, natively-integrated, open-source, code sharing pla tf orm, based on the popular, modern language kotlin. facilitates non-ui logic availability on many pla tf orms.

Slide 47

Slide 47 text

Kotlin multipla tf orm

Slide 48

Slide 48 text

Kotlin multipla tf orm

Slide 49

Slide 49 text

Kotlin multipla tf orm

Slide 50

Slide 50 text

Kotlin multipla tf orm but how can they expect to communicate?

Slide 51

Slide 51 text

Kotlin multipla tf orm but how can they expect to communicate? expect declared at common module actual declared at android module declared at iOS module declared at ...

Slide 52

Slide 52 text

Kotlin multipla tf orm Platform specif i c names?

Slide 53

Slide 53 text

Kotlin multipla tf orm Pla tf orm | common

Slide 54

Slide 54 text

Kotlin multipla tf orm commonMain src/commonMain/sample/Platform.kt expect object Platform { val name: String }

Slide 55

Slide 55 text

Kotlin multipla tf orm src/commonMain/sample/Platform.kt expect object Platform { val name: String }

Slide 56

Slide 56 text

Kotlin multipla tf orm src/commonMain/sample/Platform.kt expect object Platform { val name: String } targets: android and iOS or macOS de fi ne actual on android de fi ne actual on iOS de fi ne actual on macOS

Slide 57

Slide 57 text

Kotlin multipla tf orm src/androidMain/sample/Platform.kt actual object Platform { actual val name: String = "Android" } pla tf orm-dependent code

Slide 58

Slide 58 text

Kotlin multipla tf orm pla tf orm-dependent code actual object Platform { actual val name: String = “iOS" } src/iOSMain/sample/Platform.kt

Slide 59

Slide 59 text

Kotlin multipla tf orm src/androidMain/sample/Platform.kt actual object Platform { actual val name: String = "Android" } pla tf orm-dependent code actual object Platform { actual val name: String = “iOS" } src/iOSMain/sample/Platform.kt

Slide 60

Slide 60 text

Kotlin multipla tf orm pla tf orm-dependent code actual object Platform { actual val name: String = “macOS” } src/macosMain/sample/Platform.kt

Slide 61

Slide 61 text

Kotlin multipla tf orm pla tf orm-dependent code import io.ktor.* fun main() { embeddedServer(Netty, 9090) { routing { get("/hello") { call.respondText("Hello, API!") } } }.start(wait = true) } src/jvmMain/kotlin/Server.kt

Slide 62

Slide 62 text

Kotlin multipla tf orm

Slide 63

Slide 63 text

Kotlin multipla tf orm Actual needs to match because obviously it does

Slide 64

Slide 64 text

Kotlin multipla tf orm

Slide 65

Slide 65 text

Kotlin multipla tf orm

Slide 66

Slide 66 text

Common Kotlin Kotlin/JS JS code Kotlin/JVM JVM code Kotlin/Native Native code Kotlin multipla tf orm

Slide 67

Slide 67 text

Kotlin multipla tf orm Kotlin How much do we share Multipla tf orm What makes most sense

Slide 68

Slide 68 text

Kotlin multipla tf orm - strong community - a lot of people are using kotlin nowadays - Google and JetBrains are pushing Kotlin exclusively - you can ask questions directly at h tt ps://kotlinlang.slack.com conclusions

Slide 69

Slide 69 text

Kotlin multipla tf orm - 2x faster to develop your features business logic - 2x faster writing unit tests - One tech stack - consistency achieved across pla tf orms conclusions

Slide 70

Slide 70 text

Kotlin multipla tf orm - sta rt small, don’t try to reach 100% of shared logic - be extremely careful with all updates - IDEA, JDK, kotlin, libraries - everything. - keep versioning in mind Suggestions

Slide 71

Slide 71 text

Kotlin multipla tf orm Kotlin Slack Kotlin O ffi cial Kotlin Training Kotlin by: - h tt ps://jakewha rt on.com/presentations/ - h tt p://antonioleiva.com/kotlin Resources

Slide 72

Slide 72 text

Kotlin multipla tf orm h tt ps://github.com/joreilly/PeopleInSpace About Kotlin Multipla tf orm project with Swi ft UI, Jetpack Compose, Wear Compose, Compose for Desktop, Compose for Web and Kotlin/JS + React clients along with Ktor backend. Resources

Slide 73

Slide 73 text

Thats all folks! https:/ /linktr.ee/aldefy