使用Azure将多表SQLite Android同步

时间:2019-01-04 18:20:58

标签: java android database azure sqlite

我有一个带有sqlite数据库的android应用程序,我想使用移动服务将其同步到Azure数据库。我的数据库中有多个表,文档显示了一个表以及后端。我没有后端。我无法处理文档。

任何人都可以简单地解释如何同步多个表格,明天我将提交

P.S。我正在使用Java和Android Studio 编辑:到目前为止,我有带sqlite数据库的应用程序到CRUD。我想实现与Azure数据库多个表的同步

https://docs.microsoft.com/en-us/azure/app-service-mobile/app-service-mobile-android-get-started-offline-data

1 个答案:

答案 0 :(得分:0)

众所周知,Easy tablesEasy APIs功能足以满足您的Android应用程序的需求,该应用程序仅具有一些简单结构的表,而Azure移动应用程序本身就是后端。您可以从下面的这些文档中参考Easy tablesEasy APIs的相关部分。

enter image description here

  1. Node.js后端How to use the Mobile Apps Node.js SDK
  2. .Net后端Getting Started with Azure Mobile Apps’ Easy Tables

要解释如何同步表,我认为官方教程How to use the Azure Mobile Apps SDK for Android的{​​{3}}部分足够好。

  

Azure移动应用程序客户端SDK还通过使用SQLite数据库在本地存储服务器数据的副本来实现数据的脱机同步。在脱机表上执行的操作不需要移动连接即可​​工作。离线同步有助于恢复力和性能,但以解决冲突的复杂逻辑为代价。

对于同步映射到对象的结构简单的表,同步多个表与同步一个表相同。但是,对于复杂的对象结构映射到多表,需要在后端定义Implement Offline Sync,您可以参考我对现有SO线程call a custom API和此博客Azure offline sync of data from 1:n relationship in Android mobile app的回答。