android - How to consistantly and efficiently refresh a listview feed of content -


i have several fragment tabs , each feed of user statuses, being have 100 other users posting accounts there new data every few minutes. users choice switch fragments , fourth entire fragment reload sends http request , returns new data old data user had. doesnt seem efficient, know there has better way. can give me overview of efficient way keep data fresh without having user switch tabs , fourth?

is using sqlite and/or services comes play?

though developers , designers argue between if content should refreshed automatically of not, argue content streams shouldn't refreshed automatically unless expecting less incoming data.

i have used twitter4j stream tweets , refresh automatically in 1 of test app, twitter4j has listener lets know when new tweets received. first pushed data listview new feeds received , kind of flashy but, efficient. queued data until reached threshold , pushed data listview, bit better. thought enough but, when monitored "data usage", quite realized why shouldn't refresh automatically.

now here example implementation:

  • (suggest) type of polling or recommend implement push(like gcm) let client-side know there's new content in server.
  • (option) use syncadapter server triggered sync
  • (recommend) let user in control, it's more okay use pull-to-refresh pattern facebook or actionbar sync button google+. not make userexperience bad.

now here's how sample request api should or can match own config:

{ "fromindex": 0, "toindex": 10  ... } 

Comments

Popular posts from this blog

css - Which browser returns the correct result for getBoundingClientRect of an SVG element? -

gcc - Calling fftR4() in c from assembly -

Function that returns a formatted array in VBA -