I am creating a Android Application in Xamarin that uses Sqlite and I need the app to sync all the data from the sql server database to the sqlite database on the phone. Are there any good references for doing this as far as tutorials or examples? One thing to mention is the sqlite database for the phone would have the same schema as the server.
-
I would recommend taking a look into Azure Mobile Services and Mobile apps to handle this: github.com/jamesmontemagno/MyExpenses-Sync has a lot of good code and video content.JamesMontemagno– JamesMontemagno2015-10-20 00:17:09 +00:00Commented Oct 20, 2015 at 0:17
-
James I do have a question on that. Don't I have to pay for the azure service? The database I'm pulling from is hosted on my own network server.yams– yams2015-10-20 01:08:33 +00:00Commented Oct 20, 2015 at 1:08
1 Answer
The closest thing, within certain constraints is Azure Mobile Services with Offline Sync, but that uses it's own SQL Lite and SQL Server Instances, see https://azure.microsoft.com/en-gb/documentation/articles/mobile-services-windows-store-dotnet-get-started-offline-data/
If you are wanting to roll your own then you probably want to create your own Web Api in front of the SQL server to handle CRUD commands, and inititate that from within your app. We've done this, but there's no quick pointer, it all depends on where your 'master' data source is, how many clients, conflict management etc.
It's a huge topic