简体   繁体   English

Android自动同步自定义数据

[英]Android Auto-sync with custom data

Situation: I have an account for my application that I created following the example code at http://developer.android.com/resources/samples/SampleSyncAdapter/index.html . 情况:我的应用程序帐户是根据http://developer.android.com/resources/samples/SampleSyncAdapter/index.html上的示例代码创建的。 When clicking on the account from the Account & Sync Settings screen, I see a "Sync Contacts" checkbox. 在“帐户和同步设置”屏幕中单击该帐户时,我会看到“同步联系人”复选框。 When this checkbox is active, my custom sync successfully runs in the background. 当此复选框处于活动状态时,我的自定义同步在后台成功运行。

Problem: I'm not syncing contacts, I'm syncing the application's custom data. 问题:我没有同步联系人,我正在同步应用程序的自定义数据。 I would like the checkbox to say something like "Sync Historic Data" 我想复选框说“同步历史数据”

Question: Does anyone know where I can find some documentation on how to do this, or what steps I need to take that I can search for documentation for? 问题:有谁知道在哪里可以找到关于如何执行此操作的文档,或者我需要采取哪些步骤来搜索文档? Any advice or keywords to help broaden/guide my search would be appreciated as well. 任何建议或关键字,以帮助扩大/指导我的搜索也将不胜感激。

Just add a custom android:label attribute to the definition of your content provider in AndroidManifest.xml. 只需在AndroidManifest.xml中为自定义提供程序的定义添加自定义android:label属性即可。

Here is a nice basic tutorial covering the basics on the SyncAdapter. 是一个很好的基础教程,涵盖了SyncAdapter的基础知识。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM