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

Design Patterns for Building Network Agnostic Android Apps

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.

A840d50ff8fdfeefe6d6bd98b4f18873?s=128

Arun Babu A S P

September 12, 2017
Tweet

More Decks by Arun Babu A S P

Other Decks in Technology

Transcript

  1. Design Patterns for Building Network Agnostic Android Apps

  2. 2

  3. 3

  4. None
  5. “India has a fastest & widest network which works perfectly

    from Shimla to Tamilnadu ”
  6. None
  7. None
  8. None
  9. None
  10. LTE vs 2G

  11. LTE vs 2G

  12. What is a network agnostic mobile app?

  13. None
  14. None
  15. None
  16. None
  17. Cacheable content with Time-To-Live

  18. Server adds TTL info in all responses Cacheable content with

    Time-To-Live
  19. Server adds TTL info in all responses Client uses cache

    data if valid Cacheable content with Time-To-Live
  20. 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
  21. Cacheable content with Time-To-Live

  22. Cacheable content with Time-To-Live

  23. Content Versions, 304 responses

  24. Fetch only if content changed Content Versions, 304 responses

  25. Fetch only if content changed Useful for categories, navigations, etc.,

    Content Versions, 304 responses
  26. Fetch only if content changed Useful for categories, navigations, etc.,

    Useful for rarely changing content Content Versions, 304 responses
  27. Content Versions, 304 responses

  28. Content Versions, 304 responses

  29. Prefetching, Updating in background

  30. Progressive Web Apps follow this approach Prefetching, Updating in background

  31. Progressive Web Apps follow this approach Can download much in

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

    WiFi and avoid data Can provide offline experience Prefetching, Updating in background
  33. Prefetching, Updating in background

  34. Prefetching, Updating in background

  35. Deferred actions and lazy reports

  36. Most of the actions are not time critical Deferred actions

    and lazy reports
  37. Most of the actions are not time critical Responses for

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

    few actions are not critical Seamless experience to users Deferred actions and lazy reports
  39. Deferred actions and lazy reports

  40. Deferred actions and lazy reports

  41. Client side feed generation

  42. Client side feed generation

  43. Client side feed generation

  44. Client side feed generation

  45. Client side feed generation

  46. Client side feed generation

  47. SMS / USSD based transactions

  48. SMS / USSD based transactions

  49. SMS / USSD based transactions

  50. Prefetch & Pull notifications

  51. Periodic fetch of notifications Prefetching & pull notifications

  52. Periodic fetch of notifications Includes timestamp for showing and expiry

    Prefetching & pull notifications
  53. Periodic fetch of notifications Includes timestamp for showing and expiry

    Reduces dependency on unreliable Push infra Prefetching & pull notifications
  54. Prefetching & pull notifications

  55. Target ready notifications, messages

  56. Load resources for landing page before notify Target ready notifications,

    messages
  57. Load resources for landing page before notify Enables immediate landing

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

    to target page Improved experience in slow networks Target ready notifications, messages
  59. Target ready notifications, messages

  60. t.uber.com/indiaengcareers t.uber.com/blr_site

  61. Thanks! Arun Babu A S P Senior Android Engineer @

    Uber https://www.linkedin.com/in/arunasp/
  62. Credits Presentation template by slidescarnival.com