Which is better SMS,TCP,UDP for communication purposes on mobile phones?
I am developing an client server application on mobile phone and I would really apprecia开发者_StackOverflow社区te to get some comparisons between each of them ..
UDP may be good for streaming audio/video, but I'd expect packet loss or reordering in the context of a mobile phone. In A/V applications you can often get away with this, but if you need data integrity and packet transmission confirmation, you'll have to use TCP or SMS.
TCP coordinates packet sequencing and ensures that all data are received in-order uncorrupted. If you can, use a higher-level protocol like HTTP (which usually runs over TCP) so that you can use existing libraries, and avoid the hassle of sockets programming. TCP is subject to higher latencies than UDP, as it requires the client to send back packet confirmations; however, since you're already working from a phone, I'd expect the increased reliability to be well-worth the cost in latency. TCP is the norm for client-server applications.
SMS is great for intrusive text alerts, but I don't believe it can even carry a binary payload reliably, packet length limitation is low, I'm not sure what kind of latency you can expect, and I don't know if any integration options are available if you were to ever want to port your application to anything but a cell phone. SMS was not designed for general-purpose internet communications; I'd avoid it unless you have good reason.
精彩评论