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

Modernizing Android Development Practices

Modernizing Android Development Practices

Discuss the Latest changes in Android 14, Evolving Jetpack Compose with Material changes, Key points in starting KMM, & how KMP is evolving.

Ali Azaz Alam

December 28, 2023
Tweet

More Decks by Ali Azaz Alam

Other Decks in Technology

Transcript

  1. Modernizing Android Development Practices Discuss Latest changes in Android, Evolving

    Jetpack Compose with Material changes, Key points in starting KMM, & how KMP is evolving.
  2. Jetpack Compose Android’s recommended modern toolkit for building native UI.

    It simplifies and accelerates UI development on Android. Use declarative approach.
  3. Jetpack Glance (AndroidX library) Develop widgets optimized for Android phone,

    tablet, and foldable home screens using Jetpack Compose. • Interactive widgets • Responsive widgets • Faster UI Iteration
  4. Adaptive UI with Material 3 Components • Window Size Classes

    for canonical layout support. • Large screen optimization layout guidance. • Navigation Components for all screen sizes
  5. Cross Platform Apps with native code Kotlin Multiplatform Why it

    is different from other hybrid frameworks and how we can start?
  6. How it Started? Kotlin Multiplatform KMM – Deals with mobile

    platform. KMP - Deals for all platform, including iOS, Android, and Web
  7. How is it Changing? Kotlin Multiplatform We are deprecating the

    “Kotlin Multiplatform Mobile” (KMM) product name. From now on, “Kotlin Multiplatform” (KMP) is the preferred term when referring to the Kotlin technology for sharing code across different platforms, regardless of the combination of targets being discussed. On July 31, 2023
  8. Actual / Expect – under the hood Kotlin Multiplatform •

    Implementation that all OS would do it by themselves. • It is like a lateint modifier, means promise that I would do expect implementation at all OS side. • Expect is like an interface in Kotlin and protocol in Swift.
  9. Actual / Expect – contd.. Kotlin Multiplatform Shared folder: CommonMain

    Shared folder: AndroidMain Shared folder: iOSMain
  10. Network Operations Kotlin Multiplatform Retrofit KTOR • Create asynchronous client

    and server applications. • Kotlin Serialization – works with Ktor AlamoFire/AFNetworking Challenges: • Coroutine is bundled with Ktor to do asynchronous calls • Coroutine or suspend function • Use callback to deal Link: https://kotlinlang.org/docs/native-objc-interop.html#mappings
  11. Network Operations Kotlin Multiplatform Retrofit KTOR • Kotlin Serialization –

    works with Ktor AlamoFire/AFNetworking • Coroutine is bundled with Ktor to do asynchronous calls • Coroutine or suspend function • Use callback to deal Link: https://kotlinlang.org/docs/native-objc-interop.html#mappings Shared folder: CommonMain Shared folder: AndroidMain Shared folder: iOSMain Darwin: iOS, macOS, watchOS, tvOS
  12. Storage Operations Kotlin Multiplatform Room REALM & SQL-Delight • Delight

    -> Type safe • Delight -> Work with SQLite, MySql, and PostGresSQL. Core Data
  13. Storage Operations Kotlin Multiplatform Room REALM & SQL-Delight • Delight

    -> Type safe • Delight -> Work with SQLite, MySql, and PostGresSQL. Core Data
  14. Dependency Injection Kotlin Multiplatform Dagger/Hilt Koin • A lightweight dependency

    injection framework. • Declarative library, DSL. • Use modules for declare dependencies. • Use single{..}, singleOf{..} & factory{..}, factoryOf{..} Swinject/Manual
  15. References • Kotlin multiplatform by tutorials by the raywenderlich tutorial

    team Kevin D.Moore, Carlos Mota & Saeed Taheri • https://github.com/icerockdev • https://github.com/AAkira/Kotlin-Multiplatform-Libraries • https://student.cs.uwaterloo.ca/~cs398/1-syllabus/2-weekly-schedule/lectures/13-kotlin-multipl atform-slides.pdf • https://mmmnnnmmm.com/kotlin-kmm-swift-ios-stateflow.html • https://kotlinlang.org/docs/native-objc-interop.html#mappings • https://ktor.io/docs/getting-started-ktor-client-multiplatform-mobile.html • https://proandroiddev.com/jetpack-compose-tutorial-how-to-use-flowlayout-7216fe7cecde • https://medium.com/@domen.lanisnik/exploring-the-official-pager-in-compose-8c2698c49a98 • https://github.com/SEAbdulbasit/TravelApp-KMP • https://docs.google.com/presentation/d/11i3W38VBGrHxMaaUzrki71a24Ia-zgJoN_I_puJwW5c/e dit#slide=id.g2a12ddb6788_0_304