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

Design Patterns for Building Network Agnostic A...

Design Patterns for Building Network Agnostic Android Apps

Building apps are easy. There are so many samples & guides out there. But building them agnostic to network conditions is not easy. In fact, it is so hard when done well gets amazing returns. This talk aims to help with solid design patterns which can be applied to many usecases in developing fully functional android apps.

Arun Babu A S P

September 12, 2017
Tweet

More Decks by Arun Babu A S P

Other Decks in Technology

Transcript

  1. 2

  2. 3

  3. Server adds TTL info in all responses Client uses cache

    data if valid Cacheable content with Time-To-Live
  4. Server adds TTL info in all responses Client uses cache

    data if valid Can extend to ignore network response Cacheable content with Time-To-Live
  5. Fetch only if content changed Useful for categories, navigations, etc.,

    Useful for rarely changing content Content Versions, 304 responses
  6. Progressive Web Apps follow this approach Can download much in

    WiFi and avoid data Prefetching, Updating in background
  7. Progressive Web Apps follow this approach Can download much in

    WiFi and avoid data Can provide offline experience Prefetching, Updating in background
  8. Most of the actions are not time critical Responses for

    few actions are not critical Deferred actions and lazy reports
  9. Most of the actions are not time critical Responses for

    few actions are not critical Seamless experience to users Deferred actions and lazy reports
  10. Periodic fetch of notifications Includes timestamp for showing and expiry

    Reduces dependency on unreliable Push infra Prefetching & pull notifications
  11. Load resources for landing page before notify Enables immediate landing

    to target page Target ready notifications, messages
  12. Load resources for landing page before notify Enables immediate landing

    to target page Improved experience in slow networks Target ready notifications, messages
  13. Thanks! Arun Babu A S P Senior Android Engineer @

    Uber https://www.linkedin.com/in/arunasp/