Documentation for SyncFramework. A set of XPO providers for database synchronization created by BitFrameworks and Xari
Xpo SyncFramework is a commercial product, you can get pricing information by contacting us at info@xari.io
The official nuget feed from developer Express is required since all references comes from the nuget feed, more information here.
The official nuget feed from BitFrameworks is required. Use the following command line to add the repository
dotnet nuget add source https://nuget.bitframeworks.com/nuget/public/v3/index.json -n bitframeworks
Here you can find more information on how to add a nuget package source. https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-nuget-add-source
Install the template from a nuget file
dotnet new -i BitXari.XafSyncTemplate.21.1.3.29.nupkg
Install the template from a nuget feed
dotnet new -i BitXari.XafSyncTemplate::21.1.3.29
Install the template from a nuget feed
dotnet new -i BitXari.XafSyncTemplate::21.1.3.29 --nuget-source https://nuget.bitframeworks.com/nuget/public/v3/index.json
dotnet new -u BitXari.XafSyncTemplate
More information about uninstalling templates here https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-new-uninstall
dotnet new XafXamarinOfflineSync --help
To create a new Xaf App (windows forms net 5 and blazor net 5) application with a SyncServer
dotnet new XafXamarinOfflineSync --name YourProjectName
To create a new Xaf App (windows forms net 5 and blazor net 5) application with a SyncServer and Android client
dotnet new XafXamarinOfflineSync --name YourProjectName --android
To create a new Xaf App (windows forms net 5 and blazor net 5) application with a SyncServer and iOs client
dotnet new XafXamarinOfflineSync --name YourProjectName --ios
To create a new Xaf App (windows forms net 5 and blazor net 5) application with a SyncServer and iOs and Android clients
dotnet new XafXamarinOfflineSync --ios --android --name YourProjectName
There are many ways to connect your emulators to the sync server running in your computer, our preferred option is using Ngrok but you can also follow the official Microsoft documentation, all links below
Connect to local web services https://docs.microsoft.com/en-us/xamarin/cross-platform/deploy-test/connect-to-local-web-services
Ngrok exposes local servers behind NATs and firewalls to the public internet over secure tunnels. https://ngrok.com/
Use ngrok quickly and easily from within Visual Studio. ngrok allows you to expose a local server behind a NAT or firewall to the internet. "Demo without deploying." https://marketplace.visualstudio.com/items?itemName=DavidProthero.NgrokExtensions
When you create a solution using this template you will get a build props file as the one in the link below
<Project>
<PropertyGroup>
<!--DevExpress version-->
<DevExpressVersion>21.1.3</DevExpressVersion>
<!--SyncFramework Version-->
<SyncFrameworkVersion>21.1.3.29</SyncFrameworkVersion>
<!--demo or licensed-->
<NugetReferences>demo</NugetReferences>
<!--Additional references-->
<BITXpo>21.1.3.5841</BITXpo>
<BITAspNetCore>21.1.3.5841</BITAspNetCore>
<BITDataTransferRestClientNet>21.1.3.5841</BITDataTransferRestClientNet>
</PropertyGroup>
</Project>
Using this file you can easily change the versions of your nuget packages
- DevExpressVersion: set the version of devexpress references
- SyncFrameworkVersion: set the version of the SyncFramework
- NugetReferences: use demo to reference the trial version of the SyncFramework otherwise use licensed if you own the full version of the framework
- BITXpo: Infrastructure needed for network communication https://github.com/egarim/BitFrameWorks/tree/master/src/Xpo/BIT.Data.Xpo
- BITAspNetCore: Infrastructure needed for network communication https://github.com/egarim/BitFrameWorks/tree/master/src/Xpo/BIT.AspNetCore.Xpo
- BITDataTransferRestClientNet: needed for network communication https://github.com/egarim/BitFrameWorks/tree/master/src/Core/BIT.Data.Functions.RestClientNet
If you are new using our SyncFramework solution follow this tutorial to create your first app
Databases
- Don't share delta databases between applications
Android
- Make sure that you provide an unique name for your application package in AndroidManifest Otherwise you might end up using an old database for your application and you will get exceptions when processing the deltas
Binary data
- Avoid storing binary data on your database if it's possible, binary data (like FileData from XAF) may use a lot of space in the database, which might result in larger delta transactions. Large deltas take a longer time to synchronize and can drain your mobile device battery and data plan
- Auto generated integer primery keys:Avoid using XPObjects that uses an Integer key, integer auto-increment keys depends on the database engine internal infrastructure and they are not possible to replicate. It’s out of the scope of the SyncFramework
https://docs.devexpress.com/XPO/3311/create-a-data-model/xpo-classes-comparison
Video | |
---|---|
SyncFramwork: Synchronization Theory |
Source | Video |
---|---|
01 Synchronizing XAF Postgres database with Sqlite in Xamarin Forms |