Android离线/在线数据库访问
我正在考虑Android数据库方法。我想我的应用程序将有两种模式,离线(在没有互联网连接的地方)和在线,这将具有最高优先级。离线时,所有 DTB 查询(从 DTB 加载、保存 DTB 数据)都将使用本地 SQLite 完成。在线时,会检查离线模式下是否有更改,如果有,则在线进行相同的操作。只要 Android 手机保持在线状态,接下来的 DTB 查询就会在线完成。
事情是这样的,我计划做一些接口,对于每次访问我将定义它自己的行为。但在此之前,我一直在从 Android API 中寻找一些东西,它可以帮助我不做那个接口。我只找到了内容提供者,但在我看来,这仅对本地数据库有用。您是否知道 Android API 中的另一个有用的“东西”,它可以在这种情况下帮助我?
谢谢
I am thinking about Android database approach. I suppose my application will have two modes, offline (in places without internet connection) and online, which will have the highest priority. While offline, all DTB queries (load from DTB, save data do DTB) will be done with local SQLite. While online, there will be check, whethere something changed in offline mode, and if so, the same operations would be done online. Next DTB queries will be done online for as long as Android phone remains online.
Here is the thing, I am planning to do some Interface and for each access I will define its own behavior. But before it, I was looking for something from Android API, which could help me not to do that interface. I have found only Content Providers, but it seems to me, that this is useful only for local database. Do you know about another helpfull "thing" from Android API, which could help me in this case?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论