开发者

Android SyncAdapter without Authentication vs. Android Service

开发者 https://www.devze.com 2023-02-18 09:23 出处:网络
I don\'t wish to use authentication with my sync adaptor Since I plan to use it for syncing twitter public timeline for a search quer开发者_运维问答y.

I don't wish to use authentication with my sync adaptor Since I plan to use it for syncing twitter public timeline for a search quer开发者_运维问答y.

Shall I use SyncAdapter or any ordinary Service?


Either would work fine in this use case.

If your application might contain multiple user accounts, then going the SyncAdapter/Account route would be best as it would maintain the standard account management procedures (you can have accounts without authentication).

Using a SyncAdapter will also mean Android automatically syncs your data as needed.

With a standard service you'd need to set up the functionality if you wanted it to sync automatically every X minutes in the background, but apart from that it would be just as easy - though you'd need to do your syncing in a different thread (e.g. use an AsyncTask, I think using a SyncAdapter will do this automatically).

0

精彩评论

暂无评论...
验证码 换一张
取 消