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

Build your modern android app from scratch

Su Myat
November 26, 2022

Build your modern android app from scratch

In this talk, we will be building a composable app from scratch by following up on modern Android development best practices. You’ll leave the presentation with an understanding of the overview of all pieces you need to know for your real-world modern android app development.

Su Myat

November 26, 2022
Tweet

More Decks by Su Myat

Other Decks in Programming

Transcript

  1. What ’ll talk about today 1. Android: overview things need

    to know before we build our Android app from scratch 2. Importance: the problem with the way we build apps without architecture and why it will tire you out 3. App in Action: let’s get our hands dirty ;)
  2. What ’ll talk about today 1. What do we need

    to know before we build our Android app from scratch a. Android : brief overview b. Language : for developing our apps c. Android Studio : we use it to build apps 2. Hands on simply app in MAD way :)
  3. Overview of Android 1. Mobile Operating System designed by Google

    2. Support many different devices such as Phones/ Tablets/ TVs/ Wears and even Cars. 3. Career Demanding since most use in the world 4. Easy to start, probably easier than you think, plenty of fress courses including google official videos/ codelabs/ gudile will guide you along the way
  4. What will you need 1. Powerful computer >= 8GB run

    2. Stable Internet connection 3. Download and Install Android Studio 4. Need to have any experience with Android,you can even start learn with programming knowledge in general
  5. The common problem with how we do things 1. Retrofit:

    REST Api communication 2. Coroutine: managing background work like fetching movie list 3. ViewModel: store UI-related that survive configuration changes such as rotate screen 4. Stateflow: reacts UI when the underlying data has updates 5. Coil: Image Preview
  6. 1. All code inside activities/fragments 2. The views unnecessarily complex

    and massive 3. A small changes have to redo entire views 4. The views aren’t easy to test because of massive size and complexity 5. The code cannot be reused,tested,refactored and easily debugged. The common problem with how we do things
  7. Why an architecture will make you life easier 1. Complex

    tasks are split into simpler tasks and are easier to solve. 2. Smaller objects, less bugs,easier to debug 3. View and UI state holders like ViewModel classes stay neat and classy 4. Readability, Scalability and Portability,Testability 5. if requirements change, usually it’s quite easy to pinpoint exactly you need to change in your code with minimal implications
  8. App’s dependencies 1. Retrofit: REST Api communication 2. Coroutine: managing

    background work like fetching movie list 3. ViewModel: store UI-related that survive configuration changes such as rotate screen 4. Stateflow: reacts UI when the underlying data has updates 5. Coil: Image Preview
  9. Architecture Perform Business logic Obtains and exposes app data Data

    UI expose data Reactive UI Display data on the screen
  10. Architecture Perform Business logic Obtains and exposes app data Data

    UI expose data Reactive UI Display data on the screen Events UI layer does not pull data, only collect. Data layer handles events, updating underlying data and omitting any changes back.
  11. Architecture Perform Business logic Obtains and exposes app data Data

    UI expose data Reactive UI Display data on the screen Events Reactive UI Single source of truth Unidirectional flow
  12. Architecture in Example coroutine store movie list Data UI movie

    list Display move list on screen Save/ Unsave Favorite Movie
  13. Types of module :app :feature :core Responsible for Bringing features

    together Single user-facing functionality Single area of common functionality