Chat application - which technology is better to implement a chat application on Android

* I need to make an Android application, which is basically a chat application. * In this chat application, a user can interact with both a single user and a group, which means that group chat also exists. I use php as the back end for the database. I have never done this kind of work before, so I need suggestions or recommendations.

The options i have seen is as follow : 1. Web-services 2. Socket Programming 3. XMPP using the smack api 

Now I am confused that it is better to implement the chat function in android. Also, I have not received the code for this. One of my team members asks me to use socket programming, but I have not received a single application example or anything for socket programming in android. This time I do not know socket programming. How can we connect our phone to the server, and then to another device. Hope you get me what I want Conway.

So, someone, please guide me and show me the right direction. Also, if you can provide me with some sample code, this can be really helpful. Any help is appreciated.

+7
source share
2 answers

Another option (besides XMPP, which is certainly a valid chat approach, as it was designed for this) will use WebSocket. Using WebSocket will open the possibility of using a clean browser client.

For Android WebSocket, there is AutobahnAndroid, part of the Autobahn family of WebSocket and WAMP solutions.

WAMP is the RPC and PubSub protocol over the WebSocket protocol with several implementations. There is also an implementation of PHP WebSocket / WAMP: Ratchet .

Disclaimer: I am the author of Autobahn / WAMP and work for Tavendo.

+4
source

For a basic socket programming guide, you can check HERE and HERE .

However, I suggest using XMPP, as I mentioned HERE , as it is a protocol designed from the ground up for use in Messaging.

+4
source

All Articles