implement Microsoft sync framework with android device
Asked Answered
R

1

15

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.?

Rifling answered 1/11, 2013 at 5:55 Comment(0)
B
1

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.

Betaine answered 9/8, 2017 at 10:5 Comment(1)
Nice answer +1. Can you maybe add some code examples?Sanguineous

© 2022 - 2024 — McMap. All rights reserved.