Mamun Sardar
Mamun Sardar

Reputation: 2729

wifi chat between two or more android devices

I want to develop an chat application to chat between two or more android devices using wifi network.The application should be able to send or receive strings from each other. I have an experience of using Bluetooth network between pc and android. Can any give me any suggestion or right direction. Thanks in advance.

Upvotes: 4

Views: 23268

Answers (3)

enobufs
enobufs

Reputation: 930

If you are thinking about connecting devices that are under the same WiFi AP/router and without setting up any server, then I would suggest you to consider using UDP multicast which has been available since API level 1:

http://developer.android.com/reference/java/net/MulticastSocket.html

UDP does not guarantee data delivery (could be lost), so I would use UDP multicast for device discovery, and open up a TCP connection for data that requires guaranteed delivery. TCP listening port can be advertised via UDP multicast so that everyone can connect with each other over TCP. (There may be 3rd party tool that does this low level stuff for you.)

Upvotes: 3

pengdu
pengdu

Reputation: 1351

maybe XMPP will help, google talk uses the same protocol.

The Extensible Messaging and Presence Protocol (XMPP) is an open technology for real-time communication, which powers a wide range of applications including instant messaging, presence, multi-party chat, voice and video calls, collaboration, lightweight middleware, content syndication, and generalized routing of XML data.

things you need to do:
1. you need a server computer to run XMPP server, there are lots of open source implementations.
2. you need a XMPP client running on your android device, there are also lots of open source implementations running on android platform.

Upvotes: 0

UVM
UVM

Reputation: 9914

You can be able to chat between two android devices in Android Version 4.0.There is an API called 'Wifi P2P'.More information can be had from here:

http://developer.android.com/reference/android/net/wifi/p2p/package-summary.html

Upvotes: 4

Related Questions