Android advanced client architecture
Upcoming SlideShare
Loading in...5
×
 

Android advanced client architecture

on

  • 961 views

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

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

Statistics

Views

Total Views
961
Views on SlideShare
961
Embed Views
0

Actions

Likes
1
Downloads
10
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as OpenOffice

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment
  • Who here is first GDG? Who saw / read the android client architecture?
  • Displayed the quick, dirty and wrong Solution 1: service Solution 2: content provider Solution 3 – sync adapter
  • I'd like to share with you a story / process that I've gone through, building the next version of an applicatin that may or may not exist, in a country that may exist but soon will be under attack. In a meeting we discussed newer designs and we talked about the action bar. We placed a share button, like button and refresh button, And then – someone in the room asked:
  • My response: Well.. when the user want an updated data – he clicks on refresh and then we go and fetch... Everybody nodded ahhhh Then he asked: I thought the user ALWAYS wants the most updated data. The use case that you describe does not exists.
  • We decided to kill the refresh button. RIP After some work we had a version with no refresh in it. But....
  • OOPS – battery performance
  • DOPE. We went back to the drawing board.
  • In order to answer what the user expects we took a deeper look at our content
  • We had an argue: some said the user expects to see videos, others said the user wants to see news in the fields that he is interested in.
  • We had an argue: some said the user expects to see videos, others said the user wants to see news in the fields that he is interested in.
  • We had an argue: some said the user expects to see videos, others said the user wants to see news in the fields that he is interested in. What do you guys think? Who thinks A? Who thinks B? We decided to go with the mathematical approach
  • We decided to go with news that I like and not videos. The next question:
  • Basically there are two types of updates: 1. FG 2. BG I'm gonna talk about BG only, as FG is edge case of BG. Intense research showed that the changes are at server side. Hence – it will make sense to have server trigger updates.
  • Three types of updates: What's hot / Interesting News / Other What's hot – research shows that the change is on the server side ==> Server Trigger. Server Trigger == GCM
  • Like before: Server trigger. Let the client adjust the update frequency and not update for every change ==> Be more efficient
  • Batch: If I touch the network – Fetch “other” as well. If not – not.
  • So – our components are...
  • We can improve even more with fine grain pre-fetch and batching by being more contextual

Android advanced client architecture Android advanced client architecture Presentation Transcript

  • Android client architecture – part 2
  • Previously on Android Client Architecture
  • Once upon a time...
  • Why do we need a refresh button?
  • 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.
  • Content segmentation What's happening right now. Main headlines/ News splash News I'm interested in. General News. Videos.
  • Content segmentation – football app What's happening right now. Live score / commentary News I'm interested in. “Table” My fav team. General News.
  • What the user expects? What's happening right now Main title + News splash
  • What the user expects? What's happening right now Main title + News splash What's Hot
  • What the user expects? What's Hot
  • What the user expects? What's Hot Videos
  • What the user expects? What's Hot Interesting News What's Hot Videos
  • Let the numbers decide Nt = Navigation time. Fixed. Depends on my design Ct = Content time. Variable. Depends on the content.
  • Let the numbers decide Nt = Navigation time. Fixed. Depends on my design Ct = Content time. Variable. Depends on the content. Min(Nt / Ct)
  • What the user did not know he can expect?
  • Text to Speech News Flash / Live score.
  • Text to Speech News Flash / Live score.
  • Text to Speech News Flash / Live score. Only while driving.
  • Text to Speech News Flash / Live score. Only while driving.
  • When / How to update?
  • BG Update What's Hot BG Update Interesting News Other
  • BG Update What's Hot BG Update Interesting News Other GCM Embedded
  • GCM Embedded GCM Message can carry 4K payload. Enough for: Title Subtitle Dimestamp Image(s) URL(s) Use Multicast to send to all users.
  • GCM Embedded Zero latency What's hot is always up-to-date. No loading time Offline
  • BG Update What's Hot BG Update Interesting News Other GCM Embedded GCM + Back-off
  • Inactivity Back-off Update at periodic interval Only if received GCM notification. Double the interval for every redundant update
  • Inactivity Back-off
  • BG Update What's Hot BG Update Interesting News Other GCM Embedded GCM + Back-off Daily / Bundled
  • Batch & Bundle updates. Use SyncAdapter to handle all transactions Takes care of offline state. Easy to implement
  • What's Hot Back-Off App launch Server Interesting News Sync Adapter GCM
  • What's Hot Back-Off App launch Server Interesting News Sync Adapter GCM
  • What's Hot Back-Off App launch Server Interesting News Sync Adapter GCM
  • What's Hot Back-Off App launch Server Interesting News Sync Adapter GCM
  • 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.
  • Summary Use GCM to drive updates Use SyncAdapter to Batch and prefetch. Context is the king Which content is more important?
  • 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.
  • Happy Coding