share files with eachother via hotspot/wifi connection. There are lots of file sharing apps using this approach, for example SHAREit.
As a start, I'm mainly focusing on multiple devices sending simple text messages to each other via hotspot/wifi connection. Having one device as server, and others as clients.
I already know socket programming in java, but I have no idea how to implement socket programming concepts on android using wifi connection.
Could anyone share links related for this application?
Code chatting program using wifi/hotspot connection would be much helpful.
You have multiple options to choose from, you can use - mobile hotspots to bridge the network of two devices - WifiDirect API - You can use discovering services like NSD or JmDNS From my experience, if you dont mind how the two devices should initiate connection with each other, its best to rely on on same network transfer/mobile hotspot, then write communication code yourself. WifiDirect is also a better option over NSD or JmDNS. Initial discovery and connection time on NSD and JmDNS can suck a lot on different devices and different Android state.
Thank you for your answer. Yes, I'm choosing hotspot sharing as means of communication, yet I don't find helpful links about it. what steps should i take in order to send a text message from device one to device two using wifi / hotspot connection?
First get both the devices on the same network. Hotspot or same Wifi. Then create a server on one device, and the other device plays the client. Its normal socket networking from this point.
Обсуждают сегодня