Android advanced client architecture

Embed Size (px)

DESCRIPTION

These are the slides that I gave during Audust GDG meetup.

Citation preview

  • 1. Android client architecture part 2

2. Previously on Android Client Architecture 3. Once upon a time... 4. Why do we need a refresh button? 5. Questions we asked Why did the user download the app? To read news. To watch videos. What to show? What the user expects. What the user didn't know they could expect. 6. Content segmentation What's happening right now. Main headlines/ News splash News I'm interested in. General News. Videos. 7. Content segmentation football app What's happening right now. Live score / commentary News I'm interested in. Table My fav team. General News. 8. What the user expects? What's happening right now Main title + News splash 9. What the user expects? What's happening right now Main title + News splash What's Hot 10. What the user expects? What's Hot 11. What the user expects? What's Hot Videos 12. What the user expects? What's Hot Interesting News What's Hot Videos 13. Let the numbers decide Nt = Navigation time. Fixed. Depends on my design Ct = Content time. Variable. Depends on the content. 14. Let the numbers decide Nt = Navigation time. Fixed. Depends on my design Ct = Content time. Variable. Depends on the content. Min(Nt / Ct) 15. What the user did not know he can expect? 16. Text to Speech News Flash / Live score. 17. Text to Speech News Flash / Live score. 18. Text to Speech News Flash / Live score. Only while driving. 19. Text to Speech News Flash / Live score. Only while driving. 20. When / How to update? 21. BG Update What's Hot BG Update Interesting News Other 22. BG Update What's Hot BG Update Interesting News Other GCM Embedded 23. GCM Embedded GCM Message can carry 4K payload. Enough for: Title Subtitle Dimestamp Image(s) URL(s) Use Multicast to send to all users. 24. GCM Embedded Zero latency What's hot is always up-to-date. No loading time Offline 25. BG Update What's Hot BG Update Interesting News Other GCM Embedded GCM + Back-off 26. Inactivity Back-off Update at periodic interval Only if received GCM notification. Double the interval for every redundant update 27. Inactivity Back-off 28. BG Update What's Hot BG Update Interesting News Other GCM Embedded GCM + Back-off Daily / Bundled 29. Batch & Bundle updates. Use SyncAdapter to handle all transactions Takes care of offline state. Easy to implement 30. What's Hot Back-Off App launch Server Interesting News Sync Adapter GCM 31. What's Hot Back-Off App launch Server Interesting News Sync Adapter GCM 32. What's Hot Back-Off App launch Server Interesting News Sync Adapter GCM 33. What's Hot Back-Off App launch Server Interesting News Sync Adapter GCM 34. Context Driver Updates Is the user standing or walking? Standing user is more likely to use the app longer. Change the pre-fetch amount & frequency accordingly. 35. Summary Use GCM to drive updates Use SyncAdapter to Batch and prefetch. Context is the king Which content is more important? 36. Summary What's Hot is always up-to-date Even if we don't have network when the user launches the app Most chances that my news / my team section as well. Zero latency when launching the app. 37. Happy Coding