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

Decoding Google I/O 18 Android App

Decoding Google I/O 18 Android App

In this session, we will be decoding Google I/O 18 Android App. Is the MVP / MVC / MVVM industry standard or there is something else you need to know? How Android devs at Google do Code Organisation? Recommended Libraries and tools for Android Devs? TLDR: You will see how a modern 2018 Android App works!

Yashish Dua

October 28, 2018
Tweet

More Decks by Yashish Dua

Other Decks in Technology

Transcript

  1. Why do we need one? - Consistency and Reusability -

    Testability - Easy to change, loosely coupled - Design reflects how exactly the software works - MVP, MVPI, MVC, MVVM, ah? Architecture “Best Architecture - The one that makes the developer on your team the most productive”
  2. Major problems to be solved? 1. Layering the code To

    better define and understand relationships To create a designful approach 2. Background execution Architecture
  3. ViewModel A helper class to store and manage UI related

    data in a lifecycle conscious way. - Better than Presenters - Manages data during config changes - Easy sharing of data between multiple fragments Presentation Layer 1. Views 2. ViewModel 3. Data Binding
  4. DataBinding It is a support library which binds UI components

    in layouts to data sources. - Easier to maintain - Prevents memory leaks Presentation Layer 1. Views 2. ViewModel 3. Data Binding
  5. UseCase Class An abstract class which uses scheduler to execute

    and receive callbacks. Schedulers Default, Async and Synchronous Domain Layer 1. UseCase Class 2. Schedulers
  6. 1. Static Data - Agenda 2. Data that changes 0

    - 10 times / day - Schedule Data 3. Data that changes even without user interaction - Reservations, Session Starring Data Layer Requirement was to provide offline support
  7. Data that changes 0 - 10 times / day -

    Schedule Data - Initial version was already included in APK - Downloads fresh data when 1. User refreshes 2. FCM signal received JobScheduler is used to achieve this. OkHttp to cache the fresh data. Data Layer Requirement was to provide offline support
  8. Data that changes even without user interaction - Reservations, Session

    Starring - Firestore : NoSQL Cloud Database - Offline Support - Syncing across Web, Android, iOS Data Layer Requirement was to provide offline support
  9. Dagger 2 for dependency injection Timber for logging Gson for

    JSON parsing ThreeTen for dates and times Crashlytics Libraries and Tools Recommended
  10. This attribute allows you to specify placeholder text and images

    at preview time itself. Does not increase size of APK. Can also define dimensions and JSON sample data. Sample Data Must use helper