Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Accelerate your key learnings of scaling modern...

Accelerate your key learnings of scaling modern Android apps

Building Modern Android apps , best practices @Scale

Adit Lal

March 05, 2025
Tweet

More Decks by Adit Lal

Other Decks in Programming

Transcript

  1. Building next generation apps - all-in one Accelerate your key

    learnings of modern Android app development with KMP Adit Lal GDE Android
  2. Android GDE 🛠 Architect | Entrepreneur 🔊 Speaker 🌎 Globe

    Tro tt er 🍻 Beer enthusiast 🎯https:/ /androiddev.social/@aditlal 🔗aditlal.dev Adit GDE
  3. 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 …
  4. • Set clear goals for your Android app • De

    fi ne your target audience • Monetization & ROI Thoughts on App development
  5. • 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
  6. • 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
  7. 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
  8. 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
  9. Ownership? core auth common Feature n-1 Feature n+2 Feature n-2

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

    Feature z Feature n Feature n+1 app … … … … …
  11. • 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
  12. 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.
  13. 20 Tech Debt Solve this at the most convenient time

    possible and o ft en. Don’t stack, solve it.
  14. 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
  15. 23 Jetpack compose UI Toolkit is independent to the OS

    🪄 State Management is built in🥳 Lots of context switching 🎉 So rt ed code logic 🚀
  16. ‣ 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
  17. native ~2x the team the cost time spent in meetings

    time spent on development time spent on testing time spent on bug fi xing
  18. 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
  19. Cross-pla tf orm advantages • smaller team/s • typically half

    of the cost needed on native • small learning curve for web developers
  20. 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
  21. 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”
  22. Kotlin K otlin multipla tf orm Using kotlin in projects

    to target more than one pla tf orm
  23. Kotlin multipla tf orm “Shared UI is a history of

    pain and failure. Shared logic is the history of computers.” - Kevin Galligan
  24. 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
  25. 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.
  26. 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 ...
  27. 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
  28. Kotlin multipla tf orm pla tf orm-dependent code actual object

    Platform { actual val name: String = “iOS" } src/iOSMain/sample/Platform.kt
  29. 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
  30. Kotlin multipla tf orm pla tf orm-dependent code actual object

    Platform { actual val name: String = “macOS” } src/macosMain/sample/Platform.kt
  31. 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
  32. Kotlin multipla tf orm Kotlin How much do we share

    Multipla tf orm What makes most sense
  33. 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
  34. 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
  35. 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
  36. 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
  37. 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