Windows Phone 8 Sync

 

A lot of the below depends on the types of data, how often it is changing, and how often it is likely to conflict.

 

If:

  • The data modified offline is likely to be separate from data that is downloaded / refreshed, or
  • A data synchronisation pattern is in play for other mobile clients (iOS, Android etc)

 

Then it is probably easiest to hand roll synchronisation based off:

  • A background task downloading changes (based on ModifiedOn or similar) from a REST service.
  • Local SQLite database
  • Manually trigger refreshes on application open or explicit button commands

 

Background tasks can be triggered up to every 15 minutes if running as a lock screen application, and can handle online / offline mode switching.

Push notifications can be used if 15 minute resolution is not fine enough. Azure mobile services or notification hubs on to of Azure Service Bus would probably be the simplest way to achieve this.

 

If changes are likely to be more complex (read/write from client, concurrency protection required) then a sync framework is probably useful.

The Sync Framework Toolkit (http://syncwinrt.codeplex.com/http://blogs.msdn.com/b/mim/archive/2013/02/19/synchronization-with-sqlite-on-winrt.aspx) is the evolution for WinRT of Microsoft’s Sync Framework. This has some complexity, but if developers have used it before (and especially if backend is SQL based) this removes the requirement to rewrite much of this code.

 

posted @ 2013-11-05 04:29  MinieGoGo  阅读(318)  评论(0编辑  收藏  举报