Xamarin Offline Data Sync

Seth Isaacks 11 Reputation points
2022-05-17T18:31:18.377+00:00

Hello

I have an Xamarin cross platform application. I have a local sqlite database that I want to sync with an Azure SQL Database
I have been doing a lot of googling and watching videos.
I was watching some of the Xamarin University videos about Xamarin Azure Mobile Apps but all that seems to be outdated.
I am absolutely confused with the abundance of outdated information.

I found this link below for syncing data, however, I can't find any examples other than what is in this tutorial and it doesn't explain much.
https://learn.microsoft.com/en-us/azure/developer/mobile-apps/azure-mobile-apps/quickstarts/xamarin-android/offline

I am not sure if it would be wiser to write my own api for CRUD and sync the data myself between the sever and sqlite or use Azure Mobile Applications. However I am not entirely sure how to use azure mobile applications due to all the old/new information out there. I am not sure if I can add my existing app to Azure mobile apps.

Any help would be much appreciated

Azure SQL Database
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. Alberto Morillo 32,986 Reputation points MVP
    2022-05-17T20:18:10.153+00:00

    A year ago I answered a similar question here. Let me share the answer with you now and hopefully you can find it helpful too.

    You can use Microsoft Sync Framework to Sync SQLite and SQL Azure/SQL Server as explained here. Syn Framework provides cross-platform data synchronization.

    This synchronization framework published on GitHub may be a possible solution for you.

    Alternatively, you can create your own Web Api in front of the SQL server/SQLAzure to handle SQL DML statements. Please refer to this forum thread for detailed information.


  2. Adrian Hall (MSFT) 156 Reputation points Microsoft Employee
    2022-05-20T17:26:48.39+00:00

    Hi,

    I'm the maintainer of Azure Mobile Apps, so can give the latest information.

    The tutorial for each platform sits alongside a HOW TO, which is in-depth documentation on both the client and the server. In addition, we operate in the open at the GitHub repository https://github.com/azure/azure-mobile-apps, including a vibrant discussion board on how to build apps. The server is now ASP.NET 6 (which is the latest stuff) and it's really easy to build an backend with all the bells and whistles (like per-user authorization, pre-calculated fields, real-time notifications) to support mobile sync. The client is .NET Standard 2.0 and supports the latest Xamarin.iOS, Xamarin.Android, and Xamarin.Forms. The only reason I haven't included MAUI yet is because I'm only just trying it today.

    Unfortunately, you have reached the tutorials during a "publish block period" - check after the BUILD conference is over - we should have published all the new tutorials by then. In the interim, I've published some in-depth information on the wiki in the github site, and I'm happy to answer questions for you in the discussion boards.


  3. Basma Yousef 1 Reputation point
    2022-05-31T23:08:59.88+00:00

    There is a free tool named SQL Data Sync that can be used for syncing SQL Data Sync (hub database) with member databases (SQL Server or Azure SQL