Downlad and install the Sync Toolkit for WinRT


This tutorial is a part of a fully global tutorial :

  1. Download and install Sync Framework and Sync Toolkit for WinRT
  2. Generate the code for your database, your server and your client application
  3. Create a fully functional application
  4. Create a filtered application based on a template scope
  5. Handle conflicts

Setup processus

To create a “synchonizable application” that will work on Windows Store apps and Windows Phone 8, you need to create:

  1. A web server, which will expose all your entities, and capable of querying and updating a database (SQL SERVER in our example)
    1. Your datas come from a SQL SERVER database, which will be configured to allow synchronization with the Sync Framework
  2. A Windows store apps developed in XAML / C#, which will be capable to query your web server and by the way, store all the datas locally in a SQLite database
  3. A Windows Phone 8 application developed in XAML / C#, which will be capable to query your web server and by the way, store all the datas locally in a SQLite database


Before starting to develop your projects, be sure to meet those requirements. I know this part is boring, sometimes, but you need to read it carefuly Sourire 

Server

image31_thumb43_thumb

Before starting, you must install on your server, the latest version of Sync Framework 2.1 for .NET:

You have to choose between the x64 version and x86 version : http://www.microsoft.com/en-us/download/details.aspx?id=23217

Visual Studio and Sync Framework

If you install it on a x64 developer machine, you must install both of them, BUT you can’t install both of the x64 and x86 version of the SDK.

The solution is to install :

  1. the x64 version (http://www.microsoft.com/en-us/download/details.aspx?id=23217)
  2. the redistributables of the x86 version (http://www.microsoft.com/en-us/download/details.aspx?id=19502: Install the 3 msi)

Once everything installed, you can get the toolkit from Nuget : https://www.nuget.org/packages/SyncClient.SQLite/

image

During the preparation of your web server solution, you will have thoses assemblies :

image433_thumb

  • The first three are part of the Sync Framework 2.1
    • Microsoft.Synchronization
    • Microsoft.Synchronization.Data.Server
    • Microsoft.Synchronization.Data.SqlServer
  • The last one come from the Sync ToolKit nuget Package :
    • Microsoft.Synchronization.Services

Note: I strongly suggest to you to install a local IIS on your development machine. Working with Windows Phone 8 and a locally IIS server is usually more simple and confortable.

image103_thumb

However, if you don’t have a locally IIS web server installed, you have two solutions :

  1. Install IIS on your local machine (It’s a good thing, don’t be afraid Sourire)
  2. Try to connect your emulator on IIS Express. You can check this todo article : How To Connect a local web service from Windows Phone 8
  3. No third option, but you can also … install IIS on your local machine !


Note
: As you can imagine, in the followings sections, I will use a local IIS web server. 

Windows Store Apps

Regarding the Windows store apps development, the first thing to do is to install SQLite on your machine.

Thanks to Extensions and Update, you just have to search SQLite for Windows Runtime and install it. We will see that you will have to repeat this operation for Windows Phone 8

image313_thumb

    

You can now add the reference to the toolkit with Nuget :

image

 

Here is a screenshot of my WinRT client project references:

image

  • SQLite for Windows Runtime : Obvious Sourire
  • Microsoft.Synchronization.ClientServices.Win8 : WinRT Toolkit C# assembly installed by the Nuget package
  • SQLiteWinrt wrapper to access SQLite from a C# application
  • Microsoft Visual C++ Runtime Package : Required by SQLite

Widows Phone 8

As we have seen previously, you have to install SQLite for Windows Phone with Extensions and Updates

image613_thumb

And once again, install the WinRT Toolkit with the Nuget package :) :

image

Here is a screenshot of my Windows Phone 8 project references :

image

  • SQLite for Windows Phone : SQLite dlls for WP8
  • Microsoft.Synchronization.ClientServices.WP8 : Toolkit Windows Phone 8
  • SQLiteWinrt wrapper to access SQLite from a C# application

   
Here we go, you can synchronize your application right now !

Last edited Dec 13, 2013 at 2:40 PM by Mimetis, version 7

Comments

No comments yet.