Android的SyncAdapter不经认证的Andr​​oid与服务 [英] Android SyncAdapter without Authentication vs. Android Service

查看:125
本文介绍了Android的SyncAdapter不经认证的Andr​​oid与服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不希望使用的身份验证与我同步适配器,因为我打算用它为搜索查询同步微博公开时间表。

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 query.

我用普通SyncAdapter或任何普通服务?

Shall I use SyncAdapter or any ordinary Service?

推荐答案

要么将正常工作在这个用例。

Either would work fine in this use case.

如果您的应用程序可能包含多个用户帐户,然后去了SyncAdapter /账户的路线将是最好的,因为它会保持标准帐户管理程序(你可以有帐户,无需身份验证)。

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).

使用SyncAdapter也将意味着在需要的Andr​​oid自动同步数据。

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

通过一个标准的服务,你需要设置的功能,如果你想让它同步在后台自动每隔X分钟,但除此之外,这将是一样容易 - 虽然你需要做的同步在不同的线程(例如,使用的AsyncTask ,我想用SyncAdapter会自动执行此操作)。

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).

这篇关于Android的SyncAdapter不经认证的Andr​​oid与服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆