Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

implement Microsoft sync framework with android device

I need to implement Microsoft sync framework with my android App. I took help from here

Android example with Microsoft Sync Framework toolkit.

Updated Link: SyncFrameworkAndroid

But still i did not understand the working flow.
Anyone have any idea how to integrate Microsoft sync framework with android app to sync sqlite db to SQL server.?

like image 976
Praveen Sharma Avatar asked Nov 01 '13 05:11

Praveen Sharma


1 Answers

Yes . We have integrated this long back. It works simply on REST endpoints. Azure will expose the CRUD operations as REST API's.

On android side we need to create a java class for each table as we do for ORM.

Sync works on the basis of timestamp. There is no call called SYNC. It's basically PULL and PUSH. We have to PUSH our changes before we pull. (Not as we do in GIT pull then push). Note that order does matter. You have to sync the table in order.

Parent first then child. Else you will get in to trouble on data with relationships.

We were working on this long back. At that time azure android library has a lot of bugs. Hope it'll be fixed now. I will update a sample code soon and attach here.

You can pull the android SQlite DB outside and view the structure. It'll give a better understanding on the internal implementation. If I remember correctly. There is a table holding the changeset in local in the below format

TableName, Primary Key, Action(Modified, Created, etc), Time

On pull you can specify the action to take on conflict. Means there may be multiple users who have changed the same data. So who has preference can be set as Merge Strategy.

like image 113
Viswanath Lekshmanan Avatar answered Nov 15 '22 19:11

Viswanath Lekshmanan