sync Contacts between iPhone(also Android) and server

∥☆過路亽.° 提交于 2019-12-08 06:05:20

问题


I am in trouble and Need your help.


1st Question:

My IOS app has to send/receive datas to/from a Web Server. The server defined using the TCP and the data format is TLV; I have never used TLV before, and have no idea how to solve this problem.

As for TCP, I decide to use cocoaAsyncSocket, it's simple to deal with TCP transports; But I send/receive datas all in the (NSData*) format, I don't know if the server can decode it correctly.


2nd Question:

I am also trying to sync Contacts between local client and the server; the local client will be IOS app and Android app. Through I decide using vCard as the contacts' data format, but the vCard from iPhone contains some items(such as RelatedName) that not contained in Android; When I using vCard, there are some data lose, I can't solve this problem. Is there any good suggestion?

Somebody help me. Best regards.

=========================

Finally, I decided to use cocoaAsyncScoket for transporting data and use SQLite for storing contacts's all data; And it seems avoiding data lose is not possible.


回答1:


I completed it.

I used the GCDAsyncSocket lib to send & receive datas; As for TLV, just send the raw bytes in order under the custom defined rules will be fine.

The lib in github



来源:https://stackoverflow.com/questions/11980478/sync-contacts-between-iphonealso-android-and-server

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!