I'm beginner in android. I want to send any text data to server,and server response the any text data, I read this link:
http://examples.javacodegeeks.com/android/core/socket-core/android-socket-example/
but that link just sends text, and can not get response of server, how can I solve that?
For complete understand of whatsapp flow let me guide you the flow of whatsapp, how to replicate similar to that.extracted from blogs that I learned and applied in project is.
XMPP (Extensible Messaging and Presence Protocol) is being used by WhatsApp. To ensure network security, DSL is being used. This ensures private data transfer.
when message is sent, it is queued on the server. The message waits in the queue until the recipient reconnects to receive the message. As and when a message is delivered the sender gets notified by a double check mark near the message. After the delivery the messages are instantly deleted from the server memory.
For the database management Mnesia DB comes into play. Mnesia is a multiuser distributed DBMS which happens to be the default DB of ERLANG. Thus by using Mnesia, the app is able to achieve quicker request responses, thereby improving the overall efficiency.
FreeBSD is the operating system upon which WhatsApp is laid upon. Improvising on the ERLANG based applications and optimizing FreeBSD, WhatsApp is able to achieve better throughput. For storing multimedia files, the app uses an exclusive web server YAWS.
the technicalities of WhatsApp it is time to shift gears over analyzing the possibilities of creating a whatsApp alternative. There are plenty of messaging applications in the market that appear to be perfect WhatsApp clones. The reality is many of the attempts of building WhatsApp like similar apps are failing because they do not follow the technical aspects
Let me explain the flow of an app that can be used to develop WhatsApp clone for Android as it has the SDK ready for these widely preferred mobile operating systems. This is the flow where you can discover it.
Ejabberd, the open source Jabber server has been customized one that you can used to improve operational efficiency. The XMPP protocol has also been customized to speedup signing in and re-signing in sessions. To protect the app from DDOS attacks and to prevent account spoofing, this mobile chat application has been encrypted with HMAC.
For data storing, you can makes use of both Mnesia and MySQL. While Mnesia is used to maintain user login sessions, MySQL contributes in maintaining the user details, right from account credentials to other personal data.
logs are a key for instant messaging applications. In order to save chat history between several nodes, You can deploy Cassandra database. This database offers a good read write speed thus helping users to retrieve chat logs as and when they need.

You can refer additional information from here and here.
Hope it will help.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With