寻找在 Android 2.2 上同步的正确方法
我有一个私人在线票务系统,它有一个 RESTful 界面,可以获取票证列表、查看其详细信息并将其标记为已接受、已完成和无效。
现在,我希望可以从一个非常简单的 Android 应用程序访问此应用程序,提供与我的 Web 应用程序基本相同的功能,只是界面更精简。
作为一名 Android 开发新手,我偶然发现的问题是,我不知道要采用多种方法来同步票证。 我的应用程序的目标是基于 Android 2.2+ 的系统,因此至少有 AbstractSyncAdapter 我不清楚如何从文档中使用它。
我想到的另一种可能性是简单地设置一个计划任务,以特定的时间间隔进行同步。
另一个问题是我不太了解如何使用 ContentProviders 以及如何指定自定义内容类型(例如我的票证)。如果我只想使用自己应用程序中的数据,我是否需要这些?
理想的情况是引用一个已经实现了类似功能的不错的开源项目。 除此之外,我们非常感谢任何帮助。
谢谢。
I have a private online ticket system that has a RESTful interface to get a list of tickets, view their details and mark them as accepted, completed and invalid.
Now I want this app to be accessible from a very simple Android application, providing basically the same functionality as my web app, just with a leaner interface.
The problem that I stumbled upon as a novice Android developer was that I have no idea which of the many ways to go for synchronization of the tickets.
The target of my application are Android 2.2+ based systems so there is at least AbstractSyncAdapter which wasn't clear to me how to use from the documentation.
Another possibility that came to my mind was simply setting up a scheduled task that would do the synchronisation at specific intervals.
Another problem is that I don't really understand how to use ContentProviders and how to specify custom content types (such as my ticket). Do I need these at all if I merely want to use my data from my own application?
What would be ideal is a reference to a decent open source project that has implemented something like this already.
Apart from that any help is greatly appreciated.
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
查看示例同步适配器。
Have a look at Sample Sync Adaptor.