I am working on Sync in android. I found an Example from sample in sdk, it works fine.
In example, While they are receiving data from server they are using below protocol.
[{"e": "yt@gmail.com", "f": "Test", "i": "1709001", "h": "1-232-242-1829", "m": "1-232-242-1829", "l": "User", "o": "1-232-242-1829", "s": "This is my status", "u": "user2"}, {"e": "gj@gmail.com", "f": "Another", "i": "1702002", "h": "1-111-111-1111", "m": "1-111-111-1111", "l": "User", "o": "1-111-111-1111", "s": "another status", "u": "user3"}]
Now, My Questions
1. The开发者_如何转开发re is also inbuilt Google Sync then what protocol they are using. Same as above or any other protocol? 2. Can we create our own protocol for sync? if yes then which type of protocol should use for Sync in android?The protocol Google uses to sync with their own servers is private.
Sync on Android is not based on a defined protocol at all. You write a sync adapter, which is a software component that knows how to interact with a remote service to synchronize data with a content provider. So the sync adapter you write is what knows about the protocol; the platform itself knows nothing about it.
For example, Exchange on Android is implement as an Authenticator that takes care of logging the user in to an Exchange account, and then one sync adapter for each of the types of data it will sync (contacts, calendar, etc).
精彩评论