Android SyncAdapter without Authentication vs. Android Service
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).
精彩评论