开发者

Custom SyncAdapter without using ContentProvider

I want to create my own SyncAdapter, that syncs information from my app with some server. The thing is - I want the sync itself to run from my own application's context, using my own connection to the DB, w/o the need to access my DB using a ContentProvider.

Is that pos开发者_如何转开发sible?

Thank you,

Udi


Short answer: No, it's not possible.

Long answer: The Android platform's model for sync is to link a user Account to a ContentProvider through a SyncAdapter. You can't set up the XML tags in AndroidManifest to be read by the Android platform without having set up all three.

Biased answer: You should never write an app with a local DB. ContentProvider is by far the way to go, for the reasons listed here.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜