13
An Architecture for Robust Networking Ting Cheng

An architecture for robust networking

Embed Size (px)

Citation preview

An Architecture for Robust Networking

Ting Cheng

A Naive Request

User 不喜歡 loading view

User 可能取消 job 或者失敗

T ask 可能被 system kill

concurrent 問題

網路是不可靠的尤其是 3G mode

容易產生 memory leak

AN ARCHITECTURE FOR ROBUST NETWORKING

Content provider is a proxy

Implemented in an Android service, not an activity

http://www.youtube.com/watch?v=xHXn3Kg2IQE

centric

Service-centric

ContentProvider-centric

SyncAdapter-centric

no use AsyncTask

IntentService

ContentObserver

RESTful calls to a content provider as if all of the data were local

http://api.miiitv.com/channel/1

content://api.miiitv.com/channel/1

使用 SyncAdapter framework

移除 service

Demo