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

Android App Architecture - MCE2016

Richa
April 22, 2016

Android App Architecture - MCE2016

Richa

April 22, 2016
Tweet

More Decks by Richa

Other Decks in Technology

Transcript

  1. Available on Google Play Store Place your screenshot here Android

    App 1,825+ COURSES 18M+ LEARNERS 141+ PARTNERS
  2. 109% increase in mobile usage since last year 24 %

    use mobile only 40 % use mobile and desktop
  3. MVC

  4. MODEL VIEW CONTROLLER Manage application data Render model Handle view

    events Interact with model Invoke next UI Table of Responsibilities
  5. MODEL VIEW CONTROLLER Manage data from network Render model Handle

    view events Manage data from local storage Manage view state Interact with model Manage model consistency Navigation Interact with system components Interact with system events Update view on model changes or system events
  6. Model public class CourseModel { Course getFromDatabase() { // fetch

    from db, or local cache } Course getFromNetwork() { // fetch from apis, cache when possible } }
  7. Controller void onClick() {} void onModelUpdated() {} void onNewNotification() {}

    void onLocationUpdated(Location loc) {} void takePhoto(Activity context) {} void launchView(Activity context ) {}
  8. MODEL VIEW CONTROLLER Manage data from local storage Render model

    Handle view events Manage data from network Manage view state Interact with model Manage model consistency Navigation Interact with system components Interact with system events Update view on model changes or system events
  9. MODEL VIEW CONTROLLER INTERACTOR Manage data from local storage Render

    view data Handle view events Interact with external entities Manage data from network Manage view data/ updates Navigation Manage model consistency Forward view data updates to view
  10. MODEL VIEW CONTROLLER INTERACTOR VIEW MODEL Manage data from local

    storage Render view model Handle view events Interact with external entities Manage view data Manage data from network Navigation Manage model consistency Manage view model
  11. MODEL VIEW PRESENTER INTERACTOR VIEW MODEL Manage data from local

    storage Render view model Handle view events Interact with external entities Manage view data Manage data from network Navigation Manage model consistency Manage view model
  12. ENTITIES VIEW PRESENTER INTERACTOR VIEW MODEL Represent model objects Render

    view model Handle view events Interact with external entities Manage view data Navigation Manage view model
  13. ENTITIES VIEW PRESENTER INTERACTOR VIEW MODEL FLOW CONTROLLER Represent model

    objects Render view model Manage view events and view model Interact with external entities Manage view data Navigation
  14. CatalogInteractor Context mContext; public CatalogInteractor(Context context) { mContext = context;

    } public Observable loadCatalog() { return catalogDataSource.loadCatalog(mContext.getApplication( )); }
  15. Dealing with context Presenter(Context context) Interactor(Context context) NetworkClient(Context context) PersistenceClient(Context

    context) context.getSystemService(“SERVICE”) context.startActivity(intent) context.startActivityForResult(intent)